Skip to content

Commit

Permalink
refactor(best practices): Update rules for Prettier integration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joshwiens committed Dec 14, 2017
1 parent a11f1a8 commit 385aac8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions rules/best-practices.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ module.exports = {

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

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

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

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

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

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

// disallow multiple spaces
// http://eslint.org/docs/rules/no-multi-spaces
'no-multi-spaces': 'error',
// This is handled by Prettier in Defaults 2.0
'no-multi-spaces': 'off',

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

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

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

0 comments on commit 385aac8

Please sign in to comment.