-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
143 lines (142 loc) · 4.56 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true
},
extends: [
'eslint:recommended',
'plugin:unicorn/recommended',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:import/recommended',
'prettier'
],
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 12,
requireConfigFile: false
},
plugins: ['prettier', 'unicorn', 'import'],
overrides: [
{
files: 'server.js',
env: {browser: false, node: true}
},
{
files: './ext/**.js',
env: {webextensions: true}
}
],
globals: {
CodeMirror: 'writable',
DarkReader: 'writable',
ide: 'writable',
chrome: 'writable',
globalTemplate: 'writable',
validPanelLst: 'writable',
matchMultiple: 'writable',
unpack: 'writable',
XMLHttpRequest: 'writable',
Sortable: 'writable'
},
rules: {
'prettier/prettier': 'error',
'import/extensions': ['error', 'always'],
'accessor-pairs': 'error',
'array-callback-return': 'error',
'block-scoped-var': 'error',
'camelcase': ['error', {ignoreImports: true}],
'default-case-last': 'error',
'dot-notation': 'error',
'eqeqeq': 'error',
'func-style': ['error', 'declaration', {allowArrowFunctions: true}],
'grouped-accessor-pairs': 'error',
'init-declarations': 'error',
'lines-between-class-members': 'error',
'multiline-comment-style': ['error', 'separate-lines'],
'no-bitwise': 'error',
'no-caller': 'error',
'no-case-declarations': 'off',
'no-constant-condition': ['error', {checkLoops: false}],
'no-constructor-return': 'error',
'no-duplicate-imports': ['error', {includeExports: true}],
'no-else-return': 'error',
'no-empty': ['error', {allowEmptyCatch: true}],
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-global-assign': 'error',
'no-implicit-coercion': 'error',
'no-implied-eval': 'error',
'no-inner-declarations': 'off',
'no-iterator': 'error',
'no-label-var': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-loss-of-precision': 'error',
'no-multi-str': 'error',
'no-negated-condition': 'error',
'no-nested-ternary': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-nonoctal-decimal-escape': 'error',
'no-octal-escape': 'error',
'no-plusplus': ['error', {allowForLoopAfterthoughts: true}],
'no-promise-executor-return': 'error',
'no-proto': 'error',
'no-return-assign': ['error', 'always'],
'no-return-await': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-template-curly-in-string': 'error',
'no-throw-literal': 'error',
'no-undef-init': 'error',
'no-unneeded-ternary': 'error',
'no-unreachable-loop': 'error',
'no-unsafe-optional-chaining': 'error',
'no-unused-expressions': 'error',
'no-useless-backreference': 'error',
'no-useless-call': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-constructor': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-var': 'error',
'no-void': 'error',
'object-shorthand': 'error',
'one-var': ['error', 'never'],
'operator-assignment': 'error',
'prefer-destructuring': ['error', {VariableDeclarator: {object: true, array: true}, AssignmentExpression: {object: true, array: false}}],
'prefer-exponentiation-operator': 'error',
'prefer-numeric-literals': 'error',
'prefer-object-spread': 'error',
'prefer-regex-literals': ['error', {disallowRedundantWrapping: true}],
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'radix': 'error',
'require-atomic-updates': 'error',
'require-await': 'error',
'spaced-comment': 'error',
'strict': ['error', 'never'],
'yoda': ['error', 'never'],
// Unicorn rules
'unicorn/catch-error-name': ['error', {name: 'error'}],
'unicorn/consistent-function-scoping': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-add-event-listener': 'off',
'unicorn/prefer-array-some': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-number-properties': 'off',
'unicorn/prefer-query-selector': 'off',
'unicorn/prefer-reflect-apply': 'off',
'unicorn/prefer-string-replace-all': 'error',
'unicorn/prevent-abbreviations': 'off',
'unicorn/numeric-separators-style': 'error'
}
};