Skip to content

Commit 9d598c3

Browse files
committed
[eslint config] [base] [breaking] enable more overlooked rules:
- `no-void` - `constructor-super` - `prefer-spread` - `no-new-require` - `no-undef-init`
1 parent 4921e03 commit 9d598c3

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

packages/eslint-config-airbnb-base/rules/best-practices.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ module.exports = {
208208

209209
// disallow use of void operator
210210
// http://eslint.org/docs/rules/no-void
211-
// TODO: enable
212-
'no-void': 0,
211+
'no-void': 2,
213212

214213
// disallow usage of configurable warning terms in comments: e.g. todo
215214
'no-warning-comments': [0, { terms: ['todo', 'fixme', 'xxx'], location: 'start' }],

packages/eslint-config-airbnb-base/rules/es6.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
'arrow-spacing': [2, { before: true, after: true }],
2525

2626
// verify super() callings in constructors
27-
'constructor-super': 0,
27+
'constructor-super': 2,
2828

2929
// enforce the spacing around the * in generator functions
3030
// http://eslint.org/docs/rules/generator-star-spacing
@@ -112,7 +112,7 @@ module.exports = {
112112

113113
// suggest using the spread operator instead of .apply()
114114
// http://eslint.org/docs/rules/prefer-spread
115-
'prefer-spread': 0,
115+
'prefer-spread': 2,
116116

117117
// suggest using template literals instead of string concatenation
118118
// http://eslint.org/docs/rules/prefer-template
@@ -128,7 +128,11 @@ module.exports = {
128128

129129
// import sorting
130130
// http://eslint.org/docs/rules/sort-imports
131-
'sort-imports': 0,
131+
'sort-imports': [0, {
132+
ignoreCase: false,
133+
ignoreMemberSort: false,
134+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
135+
}],
132136

133137
// enforce usage of spacing in template strings
134138
// http://eslint.org/docs/rules/template-curly-spacing

packages/eslint-config-airbnb-base/rules/imports.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ module.exports = {
8686

8787
// No Node.js builtin modules
8888
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
89+
// TODO: enable?
8990
'import/no-nodejs-modules': 0,
9091

9192
// Style guide:

packages/eslint-config-airbnb-base/rules/node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {
1818
'no-mixed-requires': [0, false],
1919

2020
// disallow use of new operator with the require function
21-
'no-new-require': 0,
21+
'no-new-require': 2,
2222

2323
// disallow string concatenation with __dirname and __filename
2424
// http://eslint.org/docs/rules/no-path-concat

packages/eslint-config-airbnb-base/rules/variables.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ module.exports = {
2626
'no-undef': 2,
2727

2828
// disallow use of undefined when initializing variables
29-
'no-undef-init': 0,
29+
'no-undef-init': 2,
3030

3131
// disallow use of undefined variable
32+
// TODO: enable?
3233
'no-undefined': 0,
3334

3435
// disallow declaration of variables that are not used in the code

0 commit comments

Comments
 (0)