Skip to content
Permalink
Browse files

Breaking: Remove defaults from `eslint:recommended` (fixes #4809)

  • Loading branch information...
IanVS committed Dec 31, 2015
1 parent ad44518 commit e2f2b6682e966ea9c20a18d5e554050d43db6271
Showing with 70 additions and 35 deletions.
  1. +35 −35 conf/eslint.json
  2. +35 −0 docs/user-guide/migrating-to-2.0.0.md
@@ -44,7 +44,7 @@
"no-implicit-globals": 0,
"no-implied-eval": 0,
"no-inline-comments": 0,
"no-inner-declarations": [2, "functions"],
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-invalid-this": 0,
"no-irregular-whitespace": 2,
@@ -54,12 +54,12 @@
"no-lone-blocks": 0,
"no-lonely-if": 0,
"no-loop-func": 0,
"no-mixed-requires": [0, false],
"no-mixed-spaces-and-tabs": [2, false],
"linebreak-style": [0, "unix"],
"no-mixed-requires": 0,
"no-mixed-spaces-and-tabs": 2,
"linebreak-style": 0,
"no-multi-spaces": 0,
"no-multi-str": 0,
"no-multiple-empty-lines": [0, {"max": 2}],
"no-multiple-empty-lines": 0,
"no-native-reassign": 0,
"no-negated-condition": 0,
"no-negated-in-lhs": 2,
@@ -106,67 +106,67 @@
"no-unneeded-ternary": 0,
"no-unreachable": 2,
"no-unused-expressions": 0,
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
"no-unused-vars": 2,
"no-use-before-define": 0,
"no-useless-call": 0,
"no-useless-concat": 0,
"no-useless-constructor": 0,
"no-void": 0,
"no-var": 0,
"no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }],
"no-warning-comments": 0,
"no-with": 0,
"no-magic-numbers": 0,

"array-bracket-spacing": [0, "never"],
"array-bracket-spacing": 0,
"array-callback-return": 0,
"arrow-body-style": [0, "as-needed"],
"arrow-body-style": 0,
"arrow-parens": 0,
"arrow-spacing": 0,
"accessor-pairs": 0,
"block-scoped-var": 0,
"block-spacing": 0,
"brace-style": [0, "1tbs"],
"brace-style": 0,
"callback-return": 0,
"camelcase": 0,
"comma-dangle": [2, "never"],
"comma-dangle": 2,
"comma-spacing": 0,
"comma-style": 0,
"complexity": [0, 11],
"computed-property-spacing": [0, "never"],
"computed-property-spacing": 0,
"consistent-return": 0,
"consistent-this": [0, "that"],
"consistent-this": 0,
"constructor-super": 0,
"curly": [0, "all"],
"curly": 0,
"default-case": 0,
"dot-location": 0,
"dot-notation": [0, { "allowKeywords": true }],
"dot-notation": 0,
"eol-last": 0,
"eqeqeq": 0,
"func-names": 0,
"func-style": [0, "declaration"],
"func-style": 0,
"generator-star-spacing": 0,
"global-require": 0,
"guard-for-in": 0,
"handle-callback-err": 0,
"id-length": 0,
"indent": 0,
"init-declarations": 0,
"jsx-quotes": [0, "prefer-double"],
"key-spacing": [0, { "beforeColon": false, "afterColon": true }],
"jsx-quotes": 0,
"key-spacing": 0,
"keyword-spacing": 0,
"lines-around-comment": 0,
"max-depth": [0, 4],
"max-len": [0, 80, 4],
"max-nested-callbacks": [0, 2],
"max-params": [0, 3],
"max-statements": [0, 10],
"max-depth": 0,
"max-len": 0,
"max-nested-callbacks": 0,
"max-params": 0,
"max-statements": 0,
"new-cap": 0,
"new-parens": 0,
"newline-after-var": 0,
"object-curly-spacing": [0, "never"],
"object-curly-spacing": 0,
"object-shorthand": 0,
"one-var": [0, "always"],
"operator-assignment": [0, "always"],
"one-var": 0,
"operator-assignment": 0,
"operator-linebreak": 0,
"padded-blocks": 0,
"prefer-arrow-callback": 0,
@@ -176,22 +176,22 @@
"prefer-spread": 0,
"prefer-template": 0,
"quote-props": 0,
"quotes": [0, "double"],
"quotes": 0,
"radix": 0,
"id-match": 0,
"require-jsdoc": 0,
"require-yield": 0,
"semi": 0,
"semi-spacing": [0, {"before": false, "after": true}],
"semi-spacing": 0,
"sort-vars": 0,
"space-after-keywords": [0, "always"],
"space-before-keywords": [0, "always"],
"space-before-blocks": [0, "always"],
"space-before-function-paren": [0, "always"],
"space-in-parens": [0, "never"],
"space-after-keywords": 0,
"space-before-keywords": 0,
"space-before-blocks": 0,
"space-before-function-paren": 0,
"space-in-parens": 0,
"space-infix-ops": 0,
"space-return-throw-case": 0,
"space-unary-ops": [0, { "words": true, "nonwords": false }],
"space-unary-ops": 0,
"spaced-comment": 0,
"strict": 0,
"use-isnan": 2,
@@ -201,6 +201,6 @@
"wrap-iife": 0,
"wrap-regex": 0,
"yield-star-spacing": 0,
"yoda": [0, "never"]
"yoda": 0
}
}
@@ -229,3 +229,38 @@ if (variable) {
```

Further Reading: http://estools.github.io/escope/

## Default Changes When Using `eslint:recommended`

This will affect you if you are extending from `eslint:recommended`, and are enabling [`no-multiple-empty-lines`] or [`func-style`] with only a severity, such as:

```json
{
"extends": "eslint:recommended",
"rules": {
"no-multiple-empty-lines": 2,
"func-style": 2
}
}
```

The rule `no-multiple-empty-lines` has no default exceptions, but in ESLint `1.x`, a default from `eslint:recommended` was applied such that a maximum of two empty lines would be permitted.

The rule `func-style` has a default configuration of `"expression"`, but in ESLint `1.x`, `eslint:recommended` defaulted it to `"declaration"`.

ESLint 2.0.0 removes these conflicting defaults, and so you may begin seeing linting errors related to these rules.

**To address:** If you would like to maintain the previous behavior, update your configuration for `no-multiple-empty-lines` by adding `{"max": 2}`, and change `func-style` to `"declaration"`. For example:

```json
{
"extends": "eslint:recommended",
"rules": {
"no-multiple-empty-lines": [2, {"max": 2}],
"func-style": [2, "declaration"]
}
}
```

[`no-multiple-empty-lines`]: ../rules/no-multiple-empty-lines
[`func-style`]: ../rules/func-style

0 comments on commit e2f2b66

Please sign in to comment.
You can’t perform that action at this time.