eslint-config-greenpie 4.0.2 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -3
- package/base.js +9 -0
- package/index.js +6 -7
- package/jest.js +7 -0
- package/package.json +16 -7
- package/rules/base.js +315 -131
- package/rules/jest.js +71 -0
- package/rules/typescript.js +301 -0
- package/rules/vue.js +285 -0
- package/typescript.js +7 -0
- package/vue.js +7 -0
- package/.eslintrc.js +0 -10
- package/rules/best-practices.js +0 -281
- package/rules/es6.js +0 -158
- package/rules/node.js +0 -61
- package/rules/style.js +0 -566
- package/rules/variables.js +0 -52
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Pretty tough ESLint config
|
|
2
2
|
|
|
3
3
|
[](http://badge.fury.io/js/eslint-config-greenpie)
|
|
4
4
|
|
|
@@ -6,5 +6,61 @@ This package provides GreenPie's `.eslintrc` as an extensible shared config.
|
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
Install configurations
|
|
10
|
+
|
|
11
|
+
* `npm install eslint-config-greenpie --save-dev`
|
|
12
|
+
|
|
13
|
+
And then extend your local eslint config by this one
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"extends": ["eslint-config-greenpie"]
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Rulesets
|
|
22
|
+
|
|
23
|
+
Currently, here are four rulesets to extend
|
|
24
|
+
|
|
25
|
+
| Extension | Description |
|
|
26
|
+
|-------------------------------------|------------------------------------|
|
|
27
|
+
| `eslint-config-greenpie` | Includes base and typescript rules |
|
|
28
|
+
| `eslint-config-greenpie/base` | Common ESLint rules |
|
|
29
|
+
| `eslint-config-greenpie/typescript` | TypeScript-related rules |
|
|
30
|
+
| `eslint-config-greenpie/vue` | Rules for Vue projects |
|
|
31
|
+
| `eslint-config-greenpie/jest` | Rules for test files using Jest |
|
|
32
|
+
|
|
33
|
+
### Base rules
|
|
34
|
+
|
|
35
|
+
For using base rules, it requires `eslint` plugin installed
|
|
36
|
+
|
|
37
|
+
* `npm install eslint --save-dev`
|
|
38
|
+
|
|
39
|
+
### TypeScript
|
|
40
|
+
|
|
41
|
+
For TypeScript related rules, it requires a plugin and parser installed
|
|
42
|
+
|
|
43
|
+
* `npm install @typescript-eslint/eslint-plugin --save-dev`
|
|
44
|
+
* `npm install @typescript-eslint/parser --save-dev`
|
|
45
|
+
|
|
46
|
+
### Vue
|
|
47
|
+
|
|
48
|
+
For Vue-related rules, it requires a plugin installed
|
|
49
|
+
|
|
50
|
+
* `npm install eslint-plugin-vue --save-dev`
|
|
51
|
+
|
|
52
|
+
Also, if you're planning to use TypeScript alongside Vue, you will probably need to [configure another parser](https://github.com/vuejs/vue-eslint-parser#parseroptionsparser) for the `<script>` tag.
|
|
53
|
+
|
|
54
|
+
### Jest (or a similar tool like Vitest)
|
|
55
|
+
|
|
56
|
+
Additional configuration for Jest requires `eslint-plugin-jest` plugin
|
|
57
|
+
|
|
58
|
+
* `npm install eslint-plugin-jest --save-dev`
|
|
59
|
+
|
|
60
|
+
### Links
|
|
61
|
+
|
|
62
|
+
* [Registry](https://www.npmjs.com/package/eslint-config-greenpie)
|
|
63
|
+
* [Basic ESLint rules](https://eslint.org/docs/rules/)
|
|
64
|
+
* [TypeScript rules](https://typescript-eslint.io/rules/)
|
|
65
|
+
* [Vue rules](https://eslint.vuejs.org)
|
|
66
|
+
* [Jest rules](https://github.com/jest-community/eslint-plugin-jest#rules)
|
package/base.js
ADDED
package/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
const baseRules = require.resolve('./rules/base');
|
|
2
|
+
const typescriptRules = require.resolve('./rules/typescript');
|
|
3
|
+
|
|
1
4
|
module.exports = {
|
|
2
5
|
extends: [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
'eslint-config-greenpie/rules/variables',
|
|
7
|
-
'eslint-config-greenpie/rules/best-practices',
|
|
8
|
-
'eslint-config-greenpie/rules/style'
|
|
9
|
-
].map(require.resolve)
|
|
6
|
+
baseRules,
|
|
7
|
+
typescriptRules
|
|
8
|
+
]
|
|
10
9
|
};
|
package/jest.js
ADDED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-greenpie",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "GreenPie's ESLint config file",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"author": "Roman (Ky6uk)
|
|
6
|
+
"author": "Roman Nuritdinov (Ky6uk)",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/GreenPie/eslint-config-greenpie",
|
|
9
9
|
"repository": {
|
|
@@ -24,12 +24,21 @@
|
|
|
24
24
|
"greenpie",
|
|
25
25
|
"config",
|
|
26
26
|
"javascript",
|
|
27
|
-
"styleguide"
|
|
27
|
+
"styleguide",
|
|
28
|
+
"typescript",
|
|
29
|
+
"jest",
|
|
30
|
+
"react",
|
|
31
|
+
"vue"
|
|
28
32
|
],
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"eslint": "5.1.0"
|
|
31
|
-
},
|
|
32
33
|
"peerDependencies": {
|
|
33
|
-
"eslint": "5.
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
|
35
|
+
"@typescript-eslint/parser": "^5.32.0",
|
|
36
|
+
"eslint": "^8.21.0",
|
|
37
|
+
"eslint-plugin-jest": "^26.7.0",
|
|
38
|
+
"eslint-plugin-vue": "^9.3.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"eslint": "^8.21.0",
|
|
42
|
+
"eslint-formatter-gitlab": "^3.0.0"
|
|
34
43
|
}
|
|
35
44
|
}
|
package/rules/base.js
CHANGED
|
@@ -1,166 +1,350 @@
|
|
|
1
|
-
/* eslint no-magic-numbers: 0 */
|
|
2
|
-
|
|
3
1
|
module.exports = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
// https://eslint.org/docs/rules
|
|
3
|
+
extends: [
|
|
4
|
+
'eslint:recommended'
|
|
5
|
+
],
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* {@link https://eslint.org/blog/category/release-notes}
|
|
9
|
+
*/
|
|
9
10
|
rules: {
|
|
10
|
-
/**
|
|
11
|
-
* Enforce “for” loop update clause moving the counter in the right direction.
|
|
12
|
-
*
|
|
13
|
-
* @since ESLint v4.0.0-beta.0
|
|
14
|
-
* {@link http://eslint.org/docs/rules/for-direction}
|
|
15
|
-
*/
|
|
16
|
-
'for-direction': 'error',
|
|
17
11
|
|
|
18
12
|
/**
|
|
19
|
-
*
|
|
13
|
+
* Possible Problems
|
|
20
14
|
*
|
|
21
|
-
* @
|
|
22
|
-
* {@link http://eslint.org/docs/rules/getter-return}
|
|
15
|
+
* {@link https://eslint.org/docs/rules/#possible-problems}
|
|
23
16
|
*/
|
|
24
|
-
'getter-return': 'error',
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*/
|
|
18
|
+
'array-callback-return': 'error',
|
|
19
|
+
'constructor-super': 'error',
|
|
20
|
+
'for-direction': 'error',
|
|
21
|
+
'getter-return': 'error',
|
|
22
|
+
'no-async-promise-executor': 'error',
|
|
32
23
|
'no-await-in-loop': 'error',
|
|
33
|
-
|
|
34
|
-
// Disallow or Enforce Dangling Commas
|
|
35
|
-
'comma-dangle': [2, 'never'],
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Disallow comparing against -0
|
|
39
|
-
*
|
|
40
|
-
* {@link http://eslint.org/docs/rules/no-compare-neg-zero}
|
|
41
|
-
* @since ESLint v3.17.0
|
|
42
|
-
*/
|
|
24
|
+
'no-class-assign': 'error',
|
|
43
25
|
'no-compare-neg-zero': 'error',
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
'no-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'no-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
'no-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
'no-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
'no-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
'no-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
'no-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'no-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
'no-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'no-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
'no-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'no-
|
|
26
|
+
'no-cond-assign': 'error',
|
|
27
|
+
'no-const-assign': 'error',
|
|
28
|
+
'no-constant-binary-expression': 'error',
|
|
29
|
+
'no-constant-condition': 'error',
|
|
30
|
+
'no-constructor-return': 'error',
|
|
31
|
+
'no-control-regex': 'error',
|
|
32
|
+
'no-debugger': 'error',
|
|
33
|
+
'no-dupe-args': 'error',
|
|
34
|
+
'no-dupe-class-members': 'error',
|
|
35
|
+
'no-dupe-else-if': 'error',
|
|
36
|
+
'no-dupe-keys': 'error',
|
|
37
|
+
'no-duplicate-case': 'error',
|
|
38
|
+
'no-duplicate-imports': 'error',
|
|
39
|
+
'no-empty-character-class': 'error',
|
|
40
|
+
'no-empty-pattern': 'error',
|
|
41
|
+
'no-ex-assign': 'error',
|
|
42
|
+
'no-fallthrough': 'error',
|
|
43
|
+
'no-func-assign': 'error',
|
|
44
|
+
'no-import-assign': 'error',
|
|
45
|
+
'no-inner-declarations': 'error',
|
|
46
|
+
'no-invalid-regexp': 'error',
|
|
47
|
+
'no-irregular-whitespace': 'error',
|
|
48
|
+
'no-loss-of-precision': 'error',
|
|
49
|
+
'no-misleading-character-class': 'error',
|
|
50
|
+
'no-new-symbol': 'error',
|
|
51
|
+
'no-obj-calls': 'error',
|
|
52
|
+
'no-promise-executor-return': 'error',
|
|
53
|
+
'no-prototype-builtins': 'error',
|
|
54
|
+
'no-self-assign': 'error',
|
|
55
|
+
'no-self-compare': 'error',
|
|
56
|
+
'no-setter-return': 'error',
|
|
57
|
+
'no-sparse-arrays': 'error',
|
|
58
|
+
'no-template-curly-in-string': 'error',
|
|
59
|
+
'no-this-before-super': 'error',
|
|
60
|
+
'no-undef': 'error',
|
|
61
|
+
'no-unexpected-multiline': 'error',
|
|
62
|
+
'no-unmodified-loop-condition': 'error',
|
|
63
|
+
'no-unreachable': 'error',
|
|
64
|
+
'no-unreachable-loop': 'error',
|
|
65
|
+
'no-unsafe-finally': 'error',
|
|
66
|
+
'no-unsafe-negation': 'error',
|
|
67
|
+
'no-unsafe-optional-chaining': 'error',
|
|
68
|
+
'no-unused-private-class-members': 'error',
|
|
69
|
+
'no-unused-vars': 'error',
|
|
70
|
+
'no-use-before-define': 'error',
|
|
71
|
+
'no-useless-backreference': 'error',
|
|
72
|
+
'require-atomic-updates': 'error',
|
|
73
|
+
'use-isnan': 'error',
|
|
74
|
+
'valid-typeof': 'error',
|
|
80
75
|
|
|
81
76
|
/**
|
|
82
|
-
*
|
|
77
|
+
* Suggestions
|
|
83
78
|
*
|
|
84
|
-
* @
|
|
85
|
-
* {@link http://eslint.org/docs/rules/no-extra-parens}
|
|
79
|
+
* {@link https://eslint.org/docs/rules/#suggestions}
|
|
86
80
|
*/
|
|
87
|
-
'
|
|
88
|
-
|
|
81
|
+
'accessor-pairs': 'error',
|
|
82
|
+
'arrow-body-style': 'error',
|
|
83
|
+
'block-scoped-var': 'error',
|
|
84
|
+
'camelcase': 'error',
|
|
85
|
+
|
|
86
|
+
// Doesn't matter actually
|
|
87
|
+
'capitalized-comments': 'warn',
|
|
88
|
+
|
|
89
|
+
'class-methods-use-this': 'error',
|
|
90
|
+
'complexity': 'error',
|
|
91
|
+
'consistent-return': 'error',
|
|
92
|
+
'consistent-this': 'error',
|
|
93
|
+
'curly': 'error',
|
|
94
|
+
'default-case': 'off',
|
|
95
|
+
'default-case-last': 'error',
|
|
96
|
+
'default-param-last': 'error',
|
|
97
|
+
'dot-notation': 'error',
|
|
98
|
+
'eqeqeq': 'error',
|
|
99
|
+
'func-name-matching': 'error',
|
|
100
|
+
'func-names': 'error',
|
|
101
|
+
|
|
102
|
+
'func-style': ['error', 'declaration', {
|
|
103
|
+
'allowArrowFunctions': true
|
|
89
104
|
}],
|
|
90
105
|
|
|
91
|
-
|
|
92
|
-
'
|
|
106
|
+
'grouped-accessor-pairs': 'error',
|
|
107
|
+
'guard-for-in': 'error',
|
|
108
|
+
'id-denylist': 'error',
|
|
93
109
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
'no-inner-declarations': [2, 'both'],
|
|
110
|
+
'id-length': ['error', {
|
|
111
|
+
/// t — for translations
|
|
112
|
+
'exceptions': ['t']
|
|
113
|
+
}],
|
|
99
114
|
|
|
100
|
-
|
|
101
|
-
'
|
|
115
|
+
'id-match': 'error',
|
|
116
|
+
'init-declarations': 'error',
|
|
117
|
+
'max-classes-per-file': 'error',
|
|
118
|
+
'max-depth': 'error',
|
|
119
|
+
'max-lines': 'error',
|
|
120
|
+
'max-lines-per-function': 'off',
|
|
121
|
+
'max-nested-callbacks': 'error',
|
|
122
|
+
'max-params': 'error',
|
|
123
|
+
'max-statements': 'error',
|
|
124
|
+
'multiline-comment-style': 'error',
|
|
125
|
+
'new-cap': 'error',
|
|
126
|
+
'no-alert': 'error',
|
|
127
|
+
'no-array-constructor': 'error',
|
|
128
|
+
'no-bitwise': 'error',
|
|
129
|
+
'no-caller': 'error',
|
|
130
|
+
'no-case-declarations': 'error',
|
|
131
|
+
|
|
132
|
+
'no-confusing-arrow': ['error', {
|
|
133
|
+
onlyOneSimpleParam: true
|
|
134
|
+
}],
|
|
102
135
|
|
|
103
|
-
|
|
104
|
-
'no-
|
|
136
|
+
'no-console': 'error',
|
|
137
|
+
'no-continue': 'error',
|
|
138
|
+
'no-delete-var': 'error',
|
|
139
|
+
'no-div-regex': 'error',
|
|
140
|
+
'no-else-return': 'error',
|
|
141
|
+
'no-empty': 'error',
|
|
142
|
+
'no-empty-function': 'error',
|
|
143
|
+
'no-eq-null': 'error',
|
|
144
|
+
'no-eval': 'error',
|
|
145
|
+
'no-extend-native': 'error',
|
|
146
|
+
'no-extra-bind': 'error',
|
|
147
|
+
'no-extra-boolean-cast': 'error',
|
|
148
|
+
'no-extra-label': 'error',
|
|
149
|
+
'no-extra-semi': 'error',
|
|
150
|
+
'no-floating-decimal': 'error',
|
|
151
|
+
'no-global-assign': 'error',
|
|
152
|
+
'no-implicit-coercion': 'error',
|
|
153
|
+
'no-implicit-globals': 'error',
|
|
154
|
+
'no-implied-eval': 'error',
|
|
155
|
+
'no-inline-comments': 'error',
|
|
156
|
+
'no-invalid-this': 'error',
|
|
157
|
+
'no-iterator': 'error',
|
|
158
|
+
'no-label-var': 'error',
|
|
159
|
+
'no-labels': 'error',
|
|
160
|
+
'no-lone-blocks': 'error',
|
|
161
|
+
'no-lonely-if': 'error',
|
|
162
|
+
'no-loop-func': 'error',
|
|
163
|
+
|
|
164
|
+
'no-magic-numbers': ['warn', {
|
|
165
|
+
enforceConst: true,
|
|
166
|
+
detectObjects: true
|
|
167
|
+
}],
|
|
105
168
|
|
|
106
|
-
|
|
107
|
-
'no-
|
|
169
|
+
'no-mixed-operators': 'error',
|
|
170
|
+
'no-multi-assign': 'error',
|
|
171
|
+
'no-multi-str': 'error',
|
|
172
|
+
'no-negated-condition': 'error',
|
|
173
|
+
'no-nested-ternary': 'error',
|
|
174
|
+
'no-new': 'error',
|
|
175
|
+
'no-new-func': 'error',
|
|
176
|
+
'no-new-object': 'error',
|
|
177
|
+
'no-new-wrappers': 'error',
|
|
178
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
179
|
+
'no-octal': 'error',
|
|
180
|
+
'no-octal-escape': 'error',
|
|
181
|
+
'no-param-reassign': 'error',
|
|
182
|
+
'no-plusplus': 'error',
|
|
183
|
+
'no-proto': 'error',
|
|
184
|
+
'no-redeclare': 'error',
|
|
185
|
+
'no-regex-spaces': 'error',
|
|
186
|
+
'no-restricted-exports': 'error',
|
|
187
|
+
'no-restricted-globals': 'error',
|
|
188
|
+
'no-restricted-imports': 'error',
|
|
189
|
+
'no-restricted-properties': 'error',
|
|
190
|
+
'no-restricted-syntax': 'error',
|
|
191
|
+
'no-return-assign': 'error',
|
|
192
|
+
'no-return-await': 'error',
|
|
193
|
+
'no-script-url': 'error',
|
|
194
|
+
'no-sequences': 'error',
|
|
195
|
+
'no-shadow': 'error',
|
|
196
|
+
'no-shadow-restricted-names': 'error',
|
|
197
|
+
|
|
198
|
+
// Why not to use it in simple cases like "a ? b : c"
|
|
199
|
+
'no-ternary': 'off',
|
|
200
|
+
'no-throw-literal': 'error',
|
|
201
|
+
'no-undef-init': 'error',
|
|
202
|
+
'no-undefined': 'off',
|
|
203
|
+
'no-underscore-dangle': 'error',
|
|
204
|
+
'no-unneeded-ternary': 'error',
|
|
205
|
+
'no-unused-expressions': 'error',
|
|
206
|
+
'no-unused-labels': 'error',
|
|
207
|
+
'no-useless-call': 'error',
|
|
208
|
+
'no-useless-catch': 'error',
|
|
209
|
+
'no-useless-computed-key': 'error',
|
|
210
|
+
'no-useless-concat': 'error',
|
|
211
|
+
'no-useless-constructor': 'error',
|
|
212
|
+
'no-useless-escape': 'error',
|
|
213
|
+
'no-useless-rename': 'error',
|
|
214
|
+
'no-useless-return': 'error',
|
|
215
|
+
'no-var': 'error',
|
|
216
|
+
|
|
217
|
+
'no-void': ['error', {
|
|
218
|
+
allowAsStatement: true
|
|
219
|
+
}],
|
|
108
220
|
|
|
109
|
-
//
|
|
110
|
-
'no-
|
|
221
|
+
// Just notify about TODO and FIXME comments
|
|
222
|
+
'no-warning-comments': 'warn',
|
|
223
|
+
|
|
224
|
+
'no-with': 'error',
|
|
225
|
+
'object-shorthand': 'error',
|
|
226
|
+
'one-var': ['error', 'never'],
|
|
227
|
+
'one-var-declaration-per-line': 'error',
|
|
228
|
+
'operator-assignment': 'error',
|
|
229
|
+
'prefer-arrow-callback': 'error',
|
|
230
|
+
'prefer-const': 'error',
|
|
231
|
+
'prefer-destructuring': 'error',
|
|
232
|
+
'prefer-exponentiation-operator': 'error',
|
|
233
|
+
'prefer-named-capture-group': 'error',
|
|
234
|
+
'prefer-numeric-literals': 'error',
|
|
235
|
+
'prefer-object-has-own': 'error',
|
|
236
|
+
'prefer-object-spread': 'error',
|
|
237
|
+
'prefer-promise-reject-errors': 'error',
|
|
238
|
+
'prefer-regex-literals': 'error',
|
|
239
|
+
'prefer-rest-params': 'error',
|
|
240
|
+
'prefer-spread': 'error',
|
|
241
|
+
'prefer-template': 'error',
|
|
242
|
+
'quote-props': ['error', 'as-needed'],
|
|
243
|
+
'radix': 'error',
|
|
244
|
+
'require-await': 'error',
|
|
245
|
+
'require-unicode-regexp': 'error',
|
|
246
|
+
'require-yield': 'error',
|
|
247
|
+
|
|
248
|
+
'sort-imports': ['error', {
|
|
249
|
+
ignoreCase: true,
|
|
250
|
+
ignoreDeclarationSort: true,
|
|
251
|
+
ignoreMemberSort: true
|
|
252
|
+
}],
|
|
111
253
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*
|
|
115
|
-
* @since ESLint v2.11.0
|
|
116
|
-
*/
|
|
117
|
-
'no-prototype-builtins': 'error',
|
|
254
|
+
'sort-keys': 'off',
|
|
255
|
+
'sort-vars': 'error',
|
|
118
256
|
|
|
119
|
-
|
|
120
|
-
|
|
257
|
+
'spaced-comment': ['error', 'always', {
|
|
258
|
+
markers: ['/']
|
|
259
|
+
}],
|
|
121
260
|
|
|
122
|
-
|
|
123
|
-
'
|
|
261
|
+
'strict': 'error',
|
|
262
|
+
'symbol-description': 'error',
|
|
263
|
+
'vars-on-top': 'error',
|
|
264
|
+
'yoda': 'error',
|
|
124
265
|
|
|
125
266
|
/**
|
|
126
|
-
*
|
|
267
|
+
* Layout & Formatting
|
|
127
268
|
*
|
|
128
|
-
* @
|
|
129
|
-
* {@link http://eslint.org/docs/rules/no-template-curly-in-string}
|
|
269
|
+
* {@link https://eslint.org/docs/rules/#layout-formatting}
|
|
130
270
|
*/
|
|
131
|
-
'no-template-curly-in-string': 'error',
|
|
132
271
|
|
|
133
|
-
|
|
134
|
-
'
|
|
135
|
-
|
|
136
|
-
// disallow control flow statements in finally blocks
|
|
137
|
-
'no-unsafe-finally': 'error',
|
|
272
|
+
'array-bracket-newline': ['error', 'consistent'],
|
|
273
|
+
'array-bracket-spacing': 'error',
|
|
274
|
+
'array-element-newline': ['error', 'consistent'],
|
|
138
275
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
* @since ESLint v3.3.0
|
|
143
|
-
* {@link http://eslint.org/docs/rules/no-unsafe-negation}
|
|
144
|
-
*/
|
|
145
|
-
'no-unsafe-negation': 'error',
|
|
276
|
+
'arrow-parens': ['error', 'as-needed', {
|
|
277
|
+
requireForBlockBody: true
|
|
278
|
+
}],
|
|
146
279
|
|
|
147
|
-
|
|
148
|
-
'
|
|
280
|
+
'arrow-spacing': 'error',
|
|
281
|
+
'block-spacing': 'error',
|
|
282
|
+
'brace-style': 'error',
|
|
283
|
+
'comma-dangle': 'error',
|
|
284
|
+
'comma-spacing': 'error',
|
|
285
|
+
'comma-style': 'error',
|
|
286
|
+
'computed-property-spacing': 'error',
|
|
287
|
+
'dot-location': ['error', 'property'],
|
|
288
|
+
'eol-last': 'error',
|
|
289
|
+
'func-call-spacing': 'error',
|
|
290
|
+
'function-call-argument-newline': ['error', 'consistent'],
|
|
291
|
+
'function-paren-newline': ['error', 'consistent'],
|
|
292
|
+
'generator-star-spacing': 'error',
|
|
293
|
+
'implicit-arrow-linebreak': 'error',
|
|
294
|
+
'indent': ['error', 2],
|
|
295
|
+
'jsx-quotes': 'error',
|
|
296
|
+
'key-spacing': 'error',
|
|
297
|
+
'keyword-spacing': 'error',
|
|
298
|
+
'line-comment-position': 'error',
|
|
299
|
+
'linebreak-style': 'error',
|
|
300
|
+
|
|
301
|
+
'lines-around-comment': ['error', {
|
|
302
|
+
allowBlockStart: true
|
|
303
|
+
}],
|
|
149
304
|
|
|
150
|
-
|
|
151
|
-
'use-isnan': 2,
|
|
305
|
+
'lines-between-class-members': 'error',
|
|
152
306
|
|
|
153
|
-
|
|
154
|
-
|
|
307
|
+
'max-len': ['error', 120, {
|
|
308
|
+
ignoreUrls: true
|
|
309
|
+
}],
|
|
155
310
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
'
|
|
163
|
-
|
|
164
|
-
|
|
311
|
+
'max-statements-per-line': 'error',
|
|
312
|
+
|
|
313
|
+
// If it requires multilines, so it's probably better to use "if-else" instead
|
|
314
|
+
'multiline-ternary': ['error', 'never'],
|
|
315
|
+
|
|
316
|
+
'new-parens': 'error',
|
|
317
|
+
'newline-per-chained-call': 'error',
|
|
318
|
+
'no-extra-parens': 'error',
|
|
319
|
+
'no-mixed-spaces-and-tabs': 'error',
|
|
320
|
+
'no-multi-spaces': 'error',
|
|
321
|
+
'no-multiple-empty-lines': 'error',
|
|
322
|
+
'no-tabs': 'error',
|
|
323
|
+
'no-trailing-spaces': 'error',
|
|
324
|
+
'no-whitespace-before-property': 'error',
|
|
325
|
+
'nonblock-statement-body-position': 'error',
|
|
326
|
+
'object-curly-newline': 'error',
|
|
327
|
+
'object-curly-spacing': ['error', 'always'],
|
|
328
|
+
'object-property-newline': 'error',
|
|
329
|
+
'operator-linebreak': 'error',
|
|
330
|
+
'padded-blocks': ['error', 'never'],
|
|
331
|
+
'padding-line-between-statements': 'error',
|
|
332
|
+
'quotes': ['error', 'single'],
|
|
333
|
+
'rest-spread-spacing': 'error',
|
|
334
|
+
'semi': 'error',
|
|
335
|
+
'semi-spacing': 'error',
|
|
336
|
+
'semi-style': 'error',
|
|
337
|
+
'space-before-blocks': 'error',
|
|
338
|
+
'space-before-function-paren': ['error', 'never'],
|
|
339
|
+
'space-in-parens': 'error',
|
|
340
|
+
'space-infix-ops': 'error',
|
|
341
|
+
'space-unary-ops': 'error',
|
|
342
|
+
'switch-colon-spacing': 'error',
|
|
343
|
+
'template-curly-spacing': 'error',
|
|
344
|
+
'template-tag-spacing': 'error',
|
|
345
|
+
'unicode-bom': 'error',
|
|
346
|
+
'wrap-iife': 'error',
|
|
347
|
+
'wrap-regex': 'error',
|
|
348
|
+
'yield-star-spacing': 'error'
|
|
165
349
|
}
|
|
166
350
|
};
|