Skip to content

Commit 2798140

Browse files
committed
refactor(es6): Update rules for Prettier integration
BREAKING CHANGE: Requires min eslint version of 4.x. BREAKING CHANGE: Multiple rules disabled and handled by Prettier, this will change code style for defaults based projects. Upgrade: After upgrading with defaults, any editor Prettier plugin can be used to update style. The pre-commit hook will also fix & write the prettier changes.
1 parent 385aac8 commit 2798140

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

rules/es2015.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,31 @@ module.exports = {
2020

2121
// require parentheses around arrow function arguments
2222
// http://eslint.org/docs/rules/arrow-parens
23-
'arrow-parens': ['error', 'as-needed'],
23+
// This is handled by Prettier in Defaults 2.0
24+
'arrow-parens': 'off',
2425

2526
// enforce consistent spacing before and after the arrow in arrow functions
2627
// http://eslint.org/docs/rules/arrow-spacing
27-
'arrow-spacing': ['error', {
28-
before: true,
29-
after: true,
30-
}],
28+
// This is handled by Prettier in Defaults 2.0
29+
'arrow-spacing': 'off',
3130

3231
// require super() calls in constructors
3332
// http://eslint.org/docs/rules/constructor-super
3433
'constructor-super': 'error',
3534

3635
// enforce consistent spacing around * operators in generator functions
3736
// http://eslint.org/docs/rules/generator-star-spacing
38-
'generator-star-spacing': ['error', {
39-
before: false,
40-
after: true,
41-
}],
37+
// This is handled by Prettier in Defaults 2.0
38+
'generator-star-spacing': 'off',
4239

4340
// disallow reassigning class members
4441
// http://eslint.org/docs/rules/no-class-assign
4542
'no-class-assign': 'error',
4643

4744
// disallow arrow functions where they could be confused with comparisons
4845
// http://eslint.org/docs/rules/no-confusing-arrow
49-
'no-confusing-arrow': ['error', {
50-
allowParens: true,
51-
}],
46+
// This is handled by Prettier in Defaults 2.0
47+
'no-confusing-arrow': 'off',
5248

5349
// disallow reassigning const variables
5450
// http://eslint.org/docs/rules/no-const-assign
@@ -146,7 +142,8 @@ module.exports = {
146142

147143
// enforce spacing between rest and spread operators and their expressions
148144
// http://eslint.org/docs/rules/rest-spread-spacing
149-
'rest-spread-spacing': ['error', 'never'],
145+
// This is handled by Prettier in Defaults 2.0
146+
'rest-spread-spacing': 'off',
150147

151148
// enforce sorted import declarations within modules
152149
// http://eslint.org/docs/rules/sort-imports
@@ -162,10 +159,12 @@ module.exports = {
162159

163160
// require or disallow spacing around embedded expressions of template strings
164161
// http://eslint.org/docs/rules/template-curly-spacing
165-
'template-curly-spacing': 'error',
162+
// This is handled by Prettier in Defaults 2.0
163+
'template-curly-spacing': 'off',
166164

167165
// require or disallow spacing around the * in yield* expressions
168166
// http://eslint.org/docs/rules/yield-star-spacing
169-
'yield-star-spacing': ['error', 'after'],
167+
// This is handled by Prettier in Defaults 2.0
168+
'yield-star-spacing': 'off',
170169
},
171170
};

0 commit comments

Comments
 (0)