Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: add 'stricter rule config validating' in migrating docs #11905

Merged
merged 2 commits into from Jun 26, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -10,6 +10,7 @@ The lists below are ordered roughly by the number of users each change is expect
1. [`eslint:recommended` has been updated](#eslint-recommended-changes)
1. [Plugins and shareable configs are no longer affected by ESLint's location](#package-loading-simplification)
1. [The default parser now validates options more strictly](#espree-validation)
1. [Rule configuration are validated more strictly](#rule-config-validating)
1. [The `no-redeclare` rule is now more strict by default](#no-redeclare-updates)
1. [The `comma-dangle` rule is now more strict by default](#comma-dangle-updates)
1. [The `no-confusing-arrow` rule is now more lenient by default](#no-confusing-arrow-updates)
@@ -111,6 +112,22 @@ If you use a config file located outside of a local project (with the `--config`

**Related issue(s):** [eslint/eslint#9687](https://github.com/eslint/eslint/issues/9687), [eslint/espree#384](https://github.com/eslint/espree/issues/384)

## <a name="rule-config-validating"></a> Rule configuration are validated more strictly

To catch config errors earlier, ESLint v6 will report a linting error if you are trying to configure a non-existent rule.
This conversation was marked as resolved by g-plane

This comment has been minimized.

Copy link
@g-plane

g-plane Jun 26, 2019

Member
Suggested change
To catch config errors earlier, ESLint v6 will report a linting error if you are trying to configure a non-existent rule.
To catch config errors earlier, ESLint v6 will report a linting error if you are trying configuring a non-existent rule.

This comment has been minimized.

Copy link
@platinumazure

platinumazure Jun 26, 2019

Member

I think the original wording ("to configure") is correct here.

This comment has been minimized.

Copy link
@g-plane

g-plane Jun 26, 2019

Member

Does the semantic here mean "attempt to do something"?

This comment has been minimized.

Copy link
@aladdin-add

aladdin-add Jun 26, 2019

Author Member

yes. try to do sth.

This comment has been minimized.

Copy link
@kaicataldo

kaicataldo Jun 26, 2019

Member

That’s right! This can be rewritten as “...if you are attempting to configure a non-existent rule.”

This comment has been minimized.

Copy link
@g-plane

g-plane Jun 26, 2019

Member

So this should be try doing sth or attempt to do sth, not try to do sth.

This comment has been minimized.

Copy link
@kaicataldo

kaicataldo Jun 26, 2019

Member

I think it’s fine as it is. “Try doing” would be grammatically incorrect in this case.

This comment has been minimized.

Copy link
@g-plane

config | ESLint v5 | ESLint v6
------------- | ------------- | -------------
`/*eslint-enable foo*/` | no error | linting error
`/*eslint-disable(-line) foo*/` | no error | linting error
`/*eslint foo: 0*/` | no error | linting error
`{rules: {foo: 0}}` | no error | no error
`{rules: {foo: 1}` | linting warning | linting error

**To address:** You can remove the non-existent rule in your (inline) config.

**Related issue(s):** [eslint/eslint#9505](https://github.com/eslint/eslint/issues/9505)

## <a name="no-redeclare-updates"></a> The `no-redeclare` rule is now more strict by default

The default options for the [`no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule have changed from `{ builtinGlobals: false }` to `{ builtinGlobals: true }`. Additionally, the `no-redeclare` rule will now report an error for globals enabled by comments like `/* global foo */` if those globals were already enabled through configuration anyway.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.