Skip to content

Commit 385aac8

Browse files
committed
refactor(best practices): 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 a11f1a8 commit 385aac8

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

rules/best-practices.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ module.exports = {
2828

2929
// enforce consistent brace style for all control statements
3030
// http://eslint.org/docs/rules/curly
31-
curly: ['error', 'multi-line'],
31+
// This is handled by Prettier in Defaults 2.0
32+
curly: 'off',
3233

3334
// require default cases in switch statements
3435
// http://eslint.org/docs/rules/default-case
3536
'default-case': ['error', { commentPattern: '^no default$' }],
3637

3738
// enforce consistent newlines before and after dots
3839
// http://eslint.org/docs/rules/dot-location
39-
'dot-location': ['error', 'property'],
40+
// This is handled by Prettier in Defaults 2.0
41+
'dot-location': 'off',
4042

4143
// enforce dot notation whenever possible
4244
// http://eslint.org/docs/rules/dot-notation
@@ -110,7 +112,8 @@ module.exports = {
110112

111113
// disallow leading or trailing decimal points in numeric literals
112114
// http://eslint.org/docs/rules/no-floating-decimal
113-
'no-floating-decimal': 'error',
115+
// This is handled by Prettier in Defaults 2.0
116+
'no-floating-decimal': 'off',
114117

115118
// disallow assignments to native objects or read-only global variables
116119
// http://eslint.org/docs/rules/no-global-assign
@@ -164,7 +167,8 @@ module.exports = {
164167

165168
// disallow multiple spaces
166169
// http://eslint.org/docs/rules/no-multi-spaces
167-
'no-multi-spaces': 'error',
170+
// This is handled by Prettier in Defaults 2.0
171+
'no-multi-spaces': 'off',
168172

169173
// disallow multiline strings
170174
// http://eslint.org/docs/rules/no-multi-str
@@ -309,7 +313,8 @@ module.exports = {
309313

310314
// require parentheses around immediate function invocations
311315
// http://eslint.org/docs/rules/wrap-iife.html
312-
'wrap-iife': ['error', 'outside', { functionPrototypeMethods: false }],
316+
// This is handled by Prettier in Defaults 2.0
317+
'wrap-iife': 'off',
313318

314319
// require or disallow “Yoda” conditions
315320
// http://eslint.org/docs/rules/yoda

0 commit comments

Comments
 (0)