forked from MetaMask/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
78 lines (76 loc) · 2.14 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
module.exports = {
root: true,
extends: ['@metamask/eslint-config', '@metamask/eslint-config-nodejs'],
ignorePatterns: [
'!.eslintrc.js',
'!jest.config.js',
'node_modules',
'dist',
'docs',
'coverage',
'*.d.ts',
],
overrides: [
{
files: ['*.test.ts', '*.test.js'],
extends: ['@metamask/eslint-config-jest'],
},
{
files: ['*.js'],
parserOptions: {
sourceType: 'script',
ecmaVersion: '2018',
},
},
{
files: ['*.ts'],
extends: ['@metamask/eslint-config-typescript'],
rules: {
// disabled due to incompatibility with Record<string, unknown>
// See https://github.com/Microsoft/TypeScript/issues/15300#issuecomment-702872440
'@typescript-eslint/consistent-type-definitions': 'off',
// Modified to include the 'ignoreRestSiblings' option
// TODO: Migrate this rule change back into `@metamask/eslint-config`
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'all',
argsIgnorePattern: '[_]+',
ignoreRestSiblings: true,
},
],
},
},
],
rules: {
// Left disabled because various properties throughough this repo are snake_case because the
// names come from external sources or must comply with standards
// e.g. `txreceipt_status`, `signTypedData_v4`, `token_id`
camelcase: 'off',
// TODO: re-enble most of these rules
'function-paren-newline': 'off',
'guard-for-in': 'off',
'implicit-arrow-linebreak': 'off',
'import/no-anonymous-default-export': 'off',
'import/no-unassigned-import': 'off',
'lines-around-comment': 'off',
'no-async-promise-executor': 'off',
'no-case-declarations': 'off',
'no-invalid-this': 'off',
'no-negated-condition': 'off',
'no-new': 'off',
'no-param-reassign': 'off',
radix: 'off',
'require-atomic-updates': 'off',
'jsdoc/match-description': [
'error',
{ matchDescription: '^[A-Z`\\d_][\\s\\S]*[.?!`>)}]$' },
],
},
settings: {
'import/resolver': {
typescript: {},
},
},
};