From 8785103e07ecd8810c56be352f2b1d935856057f Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Fri, 20 Dec 2019 17:40:55 +0900 Subject: [PATCH 01/74] Docs: add draft of migration guide --- docs/user-guide/README.md | 1 + docs/user-guide/migrating-to-7.0.0.md | 172 ++++++++++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 docs/user-guide/migrating-to-7.0.0.md diff --git a/docs/user-guide/README.md b/docs/user-guide/README.md index 31160d16189..7339bfe08d1 100644 --- a/docs/user-guide/README.md +++ b/docs/user-guide/README.md @@ -36,3 +36,4 @@ If you were using a prior version of ESLint, you can get help with the transitio - [migrating-to-4.0.0](migrating-to-4.0.0.md) - [migrating-to-5.0.0](migrating-to-5.0.0.md) - [migrating-to-6.0.0](migrating-to-6.0.0.md) +- [migrating-to-7.0.0](migrating-to-7.0.0.md) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md new file mode 100644 index 00000000000..433be55e50c --- /dev/null +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -0,0 +1,172 @@ +# Migrating to v7.0.0 + +ESLint v7.0.0 is a major release of ESLint. We have made a few breaking changes in this release. This guide is intended to walk you through the breaking changes. + +The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users. + +## Table of Content + +### Breaking changes for users + +- [Node.js 8 is no longer supported](#drop-node-8) +- [Lint the files that match to `overrides[].files` by default](#additional-lint-targets) +- [The base path of `overrides` and `ignorePatterns` is changed](#base-path-change) +- [The place that ESLint loads plugins from is changed](#plugin-loading-change) +- [Runtime deprecation warnings on `~/.eslintrc.*` config files](#runtime-deprecation-on-personal-config-files) +- [Default ignore patterns are changed](#default-ignore-patterns) +- [Description in directive comments](#description-in-directive-comments) +- [Several rules get strict](#rules-strict) +- [`eslint:recommended` is updated](#eslint-recommended) + +### Breaking changes for plugin/custom rule developers + +- [Node.js 8 is no longer supported](#drop-node-8) +- [`CLIEngine` class has been deprecated](#deprecate-cliengine) +- [The place that ESLint loads plugins from is changed](#plugin-loading-change) + +### Breaking changes for integration developers + +- [Node.js 8 is no longer supported](#drop-node-8) +- [`CLIEngine` class has been deprecated](#deprecate-cliengine) +- [The place that ESLint loads plugins from is changed](#plugin-loading-change) + +--- + +## Node.js 8 is no longer supported + +⚠️ NOT IMPLEMENTED YET. + +Node.js 8 has been at EOL since December 2019. As a result, we have decided to drop support for it in ESLint 7. We now support the following versions of Node.js: + +- Node.js 10 (`10.12.0` and above) +- Anything above Node.js 12 + +**To address:** Make sure you upgrade to at least Node.js `10.12.0` when using ESLint 7. Mind the Node.js version of your editor when using ESLint 7 via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 6 until you are able to upgrade Node.js. + +**Related issue(s):** [RFC44](https://github.com/eslint/rfcs/blob/master/designs/2019-drop-node8/README.md) + +## Lint the files that match to `overrides[].files` by default + +⚠️ NOT IMPLEMENTED YET. + +Previously, ESLint lints only `*.js` files by default if directories are present. + + eslint src + +In the situation, ESLint 7 lints the files that match to `overrides` as well. (But it excepts patterns that end with `*` in order to avoid linting unlimitedly.) + +**To address:** Add `--ext js` option if you are using `overrides` but don't want to lint other files than `*.js` automatically. + +**Related issue(s):** [RFC20](https://github.com/eslint/rfcs/blob/master/designs/2019-additional-lint-targets/README.md) + +## The base path of `overrides` and `ignorePatterns` is changed + +⚠️ NOT IMPLEMENTED YET. + +ESLint resolves the paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns` as relative to the directory path of having the config file. + +Since ESLint 7, only if the config file is used with `--config path/to/a-config` option then ESLint resolves those paths as relative to the current working directory. + +**To address:** Update `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns` if you are using the config file with `--config` CLI option. + +**Related issue(s):** [RFC37](https://github.com/eslint/rfcs/blob/master/designs/2019-changing-base-path-in-config-files-that-cli-options-specify/README.md) + +## The place that ESLint loads plugins from is changed + +⚠️ NOT IMPLEMENTED YET. + +Previously, ESLint resolves all plugins from the current working directory by default. + +Since ESLint 7, it resolves the `plugins` setting as relative to the directory of having the _entry_ config file. (the _entry_ means that the `plugins` setting of shareable configs is resolved as relative to the directory of having the first extender.) + +This will not change anything in most cases. If a config file in a subdirectory has `plugins` setting, the plugins will be loaded from the subdirectory (or an ancestor directory). If you are using a config file of a shared location with `--config` option, the plugins the config file declare will be loaded from the shared location. + +**To address:** Install plugins to the proper place or add `--resolve-plugins-relative-to .` option to override this change. + +**Related issue(s):** [RFC47](https://github.com/eslint/rfcs/blob/master/designs/2019-plugin-loading-improvement/README.md) + +## Runtime deprecation warnings on `~/.eslintrc.*` config files + +⚠️ NOT IMPLEMENTED YET. + +Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). As planned, v7.0.0 has started to print runtime deprecation warnings. It prints the warnings when the following situations: + +1. When ESLint loaded `~/.eslintrc.*` config files because project's config was not present. +1. When ESLint ignored `~/.eslintrc.*` config files because project's config was present. (in other words, the HOME directory is an ancestor directory of the project and the project config didn't have `root:true` setting.) + +**To address:** Remove `~/.eslintrc.*` config files then add `.eslintrc.*` config files to your project directory. Or use `--config` option to use shared config files. + +**Related issue(s):** [RFC32](https://github.com/eslint/rfcs/tree/master/designs/2019-deprecating-personal-config/README.md) + +## Default ignore patterns are changed + +⚠️ NOT IMPLEMENTED YET. + +ESLint 7 ignores `node_modules/*` of subdirectories as well, but no longer ignores `bower_components/*` and `.eslintrc.js`. + +**To address:** Update your `.eslintignore` or the `ignorePatterns` property of your config file if you don't want to lint `bower_components/*` and `.eslintrc.js`. + +**Related issue(s):** RFC51 (TODO: link) + +## Description in directive comments + +⚠️ NOT IMPLEMENTED YET. + +ESLint 7 ignores the part preceded by `--` in directive comments. For example: + +```js +// eslint-disable-next-line a-rule, another-rule -- those are buggy!! +``` + +**To address:** If you have `--` surrounded by whitespaces in the configuration in directive comments, consider to move it to your config file. + +**Related issue(s):** [RFC33](https://github.com/eslint/rfcs/blob/master/designs/2019-description-in-directive-comments/README.md) + +## Several rules get strict + +⚠️ NOT IMPLEMENTED YET. + +Several rules now report more errors as enhancement: + +- [array-callback-return](https://eslint.org/docs/rules/array-callback-return) rule now recognizes `flatMap` method. +- [func-names](https://eslint.org/docs/rules/func-names) rule now recognizes function declarations in default exports. +- [no-magic-number](https://eslint.org/docs/rules/no-magic-number) rule now recognizes bigint literals. +- [yoda](https://eslint.org/docs/rules/yoda) rule now recognizes bigint literals. +- (TODO: others if exist) + +**To address:** Update your code if new warnings appeared. + +**Related issue(s):** [#11803](https://github.com/eslint/eslint/issues/11803), [#12235](https://github.com/eslint/eslint/issues/12235), [#12670](https://github.com/eslint/eslint/issues/12670) + +## `eslint:recommended` is updated + +⚠️ NOT IMPLEMENTED YET. + +TBD + +**To address:** TBD + +**Related issue(s):** TBD + +## `CLIEngine` class has been deprecated + +⚠️ NOT IMPLEMENTED YET. + +[`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint). + +Because `CLIEngine` class provides synchronous API and we have a bundle of impossible features on the synchronous API. For example, parallel linting, ES modules, and printing progress. Therefore, new `ESLint` class provides only asynchronous API. `CLIEngine` class is left as-is for migration while a time. (we have not determined when we remove `CLIEngine` class yet.) + +**To address:** Use `ESLint` class if you are using `CLIEngine` class. The `ESLint` class has similar methods: + +- `CLIEngine#addPlugin()` → `plugins` constructor option +- `CLIEngine#executeOnText()` → `ESLint#lintText()` +- `CLIEngine#executeOnFiles()` → `ESLint#lintFiles()` +- `CLIEngine#getConfigForFile()` → `ESLint#getConfigForFile()` +- `CLIEngine#getRules()` → `ESLint#getRulesForFile()` +- `CLIEngine#isPathIgnored()` → `ESLint#isPathIgnored()` +- `CLIEngine#resolveFileGlobPatterns()` → (removed) +- `CLIEngine.getFormatter()` → `ESLint#getFormatter()` +- `CLIEngine.getErrorResults()` → `ESLint.getErrorResults()` +- `CLIEngine.outputFixes()` → `ESLint.outputFixes()` + +**Related issue(s):** RFC40 (TODO: link) From 7aaaec8376c4f017ed5c72860b5886d3951935ab Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Mon, 4 May 2020 20:38:27 +0900 Subject: [PATCH 02/74] update migration guide --- docs/user-guide/migrating-to-7.0.0.md | 186 +++++++++++++++++--------- 1 file changed, 125 insertions(+), 61 deletions(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 433be55e50c..6b5094cbf88 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -10,85 +10,100 @@ The lists below are ordered roughly by the number of users each change is expect - [Node.js 8 is no longer supported](#drop-node-8) - [Lint the files that match to `overrides[].files` by default](#additional-lint-targets) -- [The base path of `overrides` and `ignorePatterns` is changed](#base-path-change) -- [The place that ESLint loads plugins from is changed](#plugin-loading-change) +- [The base path of `overrides` and `ignorePatterns` is changed if the config file is given by the `--config`/`--ignore-path` options](#base-path-change) +- [The place where ESLint loads plugins from is changed](#plugin-loading-change) - [Runtime deprecation warnings on `~/.eslintrc.*` config files](#runtime-deprecation-on-personal-config-files) - [Default ignore patterns are changed](#default-ignore-patterns) - [Description in directive comments](#description-in-directive-comments) +- [Node.js/CommonJS rules are deprecated](#deprecate-node-rules) - [Several rules get strict](#rules-strict) - [`eslint:recommended` is updated](#eslint-recommended) -### Breaking changes for plugin/custom rule developers +### Breaking changes for plugin developers - [Node.js 8 is no longer supported](#drop-node-8) -- [`CLIEngine` class has been deprecated](#deprecate-cliengine) -- [The place that ESLint loads plugins from is changed](#plugin-loading-change) +- [Lint the files that match to `overrides[].files` by default](#additional-lint-targets) +- [The place where ESLint loads plugins from is changed](#plugin-loading-change) +- [`RuleTester` class get strict](#rule-tester-strict) ### Breaking changes for integration developers - [Node.js 8 is no longer supported](#drop-node-8) +- [The place where ESLint loads plugins from is changed](#plugin-loading-change) - [`CLIEngine` class has been deprecated](#deprecate-cliengine) -- [The place that ESLint loads plugins from is changed](#plugin-loading-change) --- ## Node.js 8 is no longer supported -⚠️ NOT IMPLEMENTED YET. - -Node.js 8 has been at EOL since December 2019. As a result, we have decided to drop support for it in ESLint 7. We now support the following versions of Node.js: +Node.js 8 has been at EOL since December 2019. Therefore, we have decided to drop support for it in ESLint 7. We now support the following versions of Node.js: - Node.js 10 (`10.12.0` and above) - Anything above Node.js 12 -**To address:** Make sure you upgrade to at least Node.js `10.12.0` when using ESLint 7. Mind the Node.js version of your editor when using ESLint 7 via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 6 until you are able to upgrade Node.js. +**To address:** Make sure you upgrade to at least Node.js `10.12.0` when using ESLint 7. Mind the Node.js version of your editor when you use ESLint 7 via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 6 until you are able to upgrade Node.js. -**Related issue(s):** [RFC44](https://github.com/eslint/rfcs/blob/master/designs/2019-drop-node8/README.md) +**Related issue(s):** [RFC44](https://github.com/eslint/rfcs/blob/master/designs/2019-drop-node8/README.md), [#12700](https://github.com/eslint/eslint/pull/12700) ## Lint the files that match to `overrides[].files` by default -⚠️ NOT IMPLEMENTED YET. +Previously, ESLint lints only `*.js` files by default if directories are present such as below. + +``` +$ eslint src +``` -Previously, ESLint lints only `*.js` files by default if directories are present. +In the situation, ESLint 7 lints the files that match to `overrides[].files` along with `*.js` files. (But it excepts patterns that end with `*` in order to avoid linting unlimitedly.) For example, if the following config file is present, - eslint src +```yml +# .eslintrc.yml +extends: my-config-js +overrides: + - files: "*.ts" + extends: my-config-ts +``` -In the situation, ESLint 7 lints the files that match to `overrides` as well. (But it excepts patterns that end with `*` in order to avoid linting unlimitedly.) +then the `eslint src` command checks both `*.js` and `*.ts` files in the `src` directory. -**To address:** Add `--ext js` option if you are using `overrides` but don't want to lint other files than `*.js` automatically. +**To address:** Add `--ext js` option if you are using `overrides` but don't want to lint other files than `*.js`. The `--ext` CLI option overrides this new behavior completely. -**Related issue(s):** [RFC20](https://github.com/eslint/rfcs/blob/master/designs/2019-additional-lint-targets/README.md) +If you maintain plugins which check other kinds of files than `.js`, it may be convenient if the `recommended` preset of your plugin has the `overrides` setting in order to check the files by default. -## The base path of `overrides` and `ignorePatterns` is changed +**Related issue(s):** [RFC20](https://github.com/eslint/rfcs/blob/master/designs/2019-additional-lint-targets/README.md), [#12677](https://github.com/eslint/eslint/pull/12677) -⚠️ NOT IMPLEMENTED YET. +## The base path of `overrides` and `ignorePatterns` is changed if the config file is given by the `--config`/`--ignore-path` options -ESLint resolves the paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns` as relative to the directory path of having the config file. +ESLint resolves the following paths as relative to the directory path of having the _entry_ config file. (the _entry_ means that the settings of shareable configs are resolved as relative to the directory of having the first extender.) -Since ESLint 7, only if the config file is used with `--config path/to/a-config` option then ESLint resolves those paths as relative to the current working directory. +- Configuration files (`.eslintrc.*`) + - relative paths in the `overrides[].files` setting + - relative paths in the `overrides[].excludedFiles` setting + - paths which start with `/` in the `ignorePatterns` setting +- Ignore files (`.eslintignore`) + - paths which start with `/` -**To address:** Update `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns` if you are using the config file with `--config` CLI option. +ESLint 7 keeps this behavior in most cases, but only if the config file is given via either `--config path/to/a-config` or `--ignore-path path/to/a-ignore` options then ESLint resolves those paths as relative to the current working directory rather than the file location. -**Related issue(s):** [RFC37](https://github.com/eslint/rfcs/blob/master/designs/2019-changing-base-path-in-config-files-that-cli-options-specify/README.md) +**To address:** Update those paths if you are using the config file via `--config` or `--ignore-path` CLI options. -## The place that ESLint loads plugins from is changed +**Related issue(s):** [RFC37](https://github.com/eslint/rfcs/blob/master/designs/2019-changing-base-path-in-config-files-that-cli-options-specify/README.md), [#12887](https://github.com/eslint/eslint/pull/12887) -⚠️ NOT IMPLEMENTED YET. +## The place where ESLint loads plugins from is changed Previously, ESLint resolves all plugins from the current working directory by default. Since ESLint 7, it resolves the `plugins` setting as relative to the directory of having the _entry_ config file. (the _entry_ means that the `plugins` setting of shareable configs is resolved as relative to the directory of having the first extender.) -This will not change anything in most cases. If a config file in a subdirectory has `plugins` setting, the plugins will be loaded from the subdirectory (or an ancestor directory). If you are using a config file of a shared location with `--config` option, the plugins the config file declare will be loaded from the shared location. +This will not change anything in most cases. If a config file in a subdirectory has `plugins` setting, the plugins will be loaded from the subdirectory (or ancestor directories that include the current working directory if not found). + +If you are using a config file of a shared location via `--config` option, the plugins the config file declare will be loaded from the shared location. **To address:** Install plugins to the proper place or add `--resolve-plugins-relative-to .` option to override this change. -**Related issue(s):** [RFC47](https://github.com/eslint/rfcs/blob/master/designs/2019-plugin-loading-improvement/README.md) +**Related issue(s):** [RFC47](https://github.com/eslint/rfcs/blob/master/designs/2019-plugin-loading-improvement/README.md), [#12922](https://github.com/eslint/eslint/pull/12922) ## Runtime deprecation warnings on `~/.eslintrc.*` config files -⚠️ NOT IMPLEMENTED YET. - Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). As planned, v7.0.0 has started to print runtime deprecation warnings. It prints the warnings when the following situations: 1. When ESLint loaded `~/.eslintrc.*` config files because project's config was not present. @@ -96,21 +111,28 @@ Personal config files have been deprecated since [v6.7.0](https://eslint.org/blo **To address:** Remove `~/.eslintrc.*` config files then add `.eslintrc.*` config files to your project directory. Or use `--config` option to use shared config files. -**Related issue(s):** [RFC32](https://github.com/eslint/rfcs/tree/master/designs/2019-deprecating-personal-config/README.md) +**Related issue(s):** [RFC32](https://github.com/eslint/rfcs/tree/master/designs/2019-deprecating-personal-config/README.md), [#12678](https://github.com/eslint/eslint/pull/12678) ## Default ignore patterns are changed -⚠️ NOT IMPLEMENTED YET. +Previously, ESLint ignores the following files: -ESLint 7 ignores `node_modules/*` of subdirectories as well, but no longer ignores `bower_components/*` and `.eslintrc.js`. +- Dotfiles (`.*`) +- `node_modules` in the current working directory (`/node_modules/*`) +- `bower_components` in the current working directory (`/bower_components/*`) -**To address:** Update your `.eslintignore` or the `ignorePatterns` property of your config file if you don't want to lint `bower_components/*` and `.eslintrc.js`. +ESLint 7 ignores `node_modules/*` of subdirectories as well, but no longer ignores `bower_components/*` and `.eslintrc.js`. Therefore, the new default ignore patterns are: -**Related issue(s):** RFC51 (TODO: link) +- Dotfiles except `.eslintrc.*` (`.*` but not `.eslintrc.*`) +- `node_modules` (`/**/node_modules/*`) + +**To address:** Modify your `.eslintignore` or the `ignorePatterns` property of your config file if you don't want to lint `bower_components/*` and `.eslintrc.js`. + +**Related issue(s):** [RFC51](https://github.com/eslint/rfcs/blob/master/designs/2019-update-default-ignore-patterns/README.md), [#12888](https://github.com/eslint/eslint/pull/12888) ## Description in directive comments -⚠️ NOT IMPLEMENTED YET. +Previously, ESLint doesn't have the official way to write the reason for directive comments like `/*eslint-disable*/`, but it's better if directive comments have the reason description. ESLint 7 ignores the part preceded by `--` in directive comments. For example: @@ -120,53 +142,95 @@ ESLint 7 ignores the part preceded by `--` in directive comments. For example: **To address:** If you have `--` surrounded by whitespaces in the configuration in directive comments, consider to move it to your config file. -**Related issue(s):** [RFC33](https://github.com/eslint/rfcs/blob/master/designs/2019-description-in-directive-comments/README.md) +**Related issue(s):** [RFC33](https://github.com/eslint/rfcs/blob/master/designs/2019-description-in-directive-comments/README.md), [#12699](https://github.com/eslint/eslint/pull/12699) -## Several rules get strict +## Node.js/CommonJS rules are deprecated -⚠️ NOT IMPLEMENTED YET. +Ten rules about Node.js/CommonJS are deprecated and moved to the [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) plugin. + +**To address:** As [our deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), you can continue to use the deprecated rules. But the source code of the deprecated rules has been frozen, so we don't fix any bugs of those rules anymore. Therefore, we recommend using the corresponded plugin rules instead. + +| Deprecated Rules | Alternative | +| :--------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ | +| [callback-return](https://eslint.org/docs/rules/callback-return) | [node/callback-return](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/callback-return.md) | +| [global-require](https://eslint.org/docs/rules/global-require) | [node/global-require](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/global-require.md) | +| [handle-callback-err](https://eslint.org/docs/rules/handle-callback-err) | [node/handle-callback-err](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/handle-callback-err.md) | +| [no-mixed-requires](https://eslint.org/docs/rules/no-mixed-requires) | [node/no-mixed-requires](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-mixed-requires.md) | +| [no-new-require](https://eslint.org/docs/rules/no-new-require) | [node/no-new-require](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-new-require.md) | +| [no-path-concat](https://eslint.org/docs/rules/no-path-concat) | [node/no-path-concat](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-path-concat.md) | +| [no-process-env](https://eslint.org/docs/rules/no-process-env) | [node/no-process-env](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-process-env.md) | +| [no-process-exit](https://eslint.org/docs/rules/no-process-exit) | [node/no-process-exit](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-process-exit.md) | +| [no-restricted-modules](https://eslint.org/docs/rules/no-restricted-modules) | [node/no-restricted-require](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-restricted-require.md) | +| [no-sync](https://eslint.org/docs/rules/no-sync) | [node/no-sync](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-sync.md) | + +**Related issue(s):** [#12898](https://github.com/eslint/eslint/pull/12898) + +## Several rules get strict Several rules now report more errors as enhancement: +- [accessor-pairs](https://eslint.org/docs/rules/accessor-pairs) rule now recognizes class members by default. - [array-callback-return](https://eslint.org/docs/rules/array-callback-return) rule now recognizes `flatMap` method. +- [computed-property-spacing](https://eslint.org/docs/rules/computed-property-spacing) rule now recognizes class members by default. - [func-names](https://eslint.org/docs/rules/func-names) rule now recognizes function declarations in default exports. +- [no-extra-parens](https://eslint.org/docs/rules/no-extra-parens) rule now recognizes parentheses in assignment targets. +- [no-dupe-class-members](https://eslint.org/docs/rules/no-dupe-class-members) rule now recognizes computed keys if it's static. - [no-magic-number](https://eslint.org/docs/rules/no-magic-number) rule now recognizes bigint literals. +- [radix](https://eslint.org/docs/rules/radix) rule now recognizes invalid numbers at the second parameter of `parseInt()`. +- [use-isnan](https://eslint.org/docs/rules/use-isnan) rule now recognizes class members by default. - [yoda](https://eslint.org/docs/rules/yoda) rule now recognizes bigint literals. -- (TODO: others if exist) -**To address:** Update your code if new warnings appeared. +**To address:** Modify your code if new warnings appeared. -**Related issue(s):** [#11803](https://github.com/eslint/eslint/issues/11803), [#12235](https://github.com/eslint/eslint/issues/12235), [#12670](https://github.com/eslint/eslint/issues/12670) +**Related issue(s):** [#12490](https://github.com/eslint/eslint/pull/12490), [#12608](https://github.com/eslint/eslint/pull/12608), [#12670](https://github.com/eslint/eslint/pull/12670), [#12701](https://github.com/eslint/eslint/pull/12701), [#12765](https://github.com/eslint/eslint/pull/12765), [#12837](https://github.com/eslint/eslint/pull/12837), [#12913](https://github.com/eslint/eslint/pull/12913), [#12915](https://github.com/eslint/eslint/pull/12915), [#12919](https://github.com/eslint/eslint/pull/12919) ## `eslint:recommended` is updated -⚠️ NOT IMPLEMENTED YET. +Three new rules are enabled by the `eslint:recommended` preset. -TBD +- [no-dupe-else-if](https://eslint.org/docs/rules/no-dupe-else-if) +- [no-import-assign](https://eslint.org/docs/rules/no-import-assign) +- [no-setter-return](https://eslint.org/docs/rules/no-setter-return) -**To address:** TBD +**To address:** Modify your code if new warnings appeared. -**Related issue(s):** TBD +**Related issue(s):** [#12920](https://github.com/eslint/eslint/pull/12920) -## `CLIEngine` class has been deprecated +## `RuleTester` class get strict -⚠️ NOT IMPLEMENTED YET. +The `RuleTester` now recognizes more mistakes: + +- It fails test-cases if the rule uses either of non-standard properties `node.start` and `node.end`. Use `node.range` instead. +- It fails test-cases if the rule provides autofix but the test-case doesn't have the `output` property. Add the `output` property to test autofix. +- It fails test-cases if any unknown properties are found in the objects in the `errors` property. + +**To address:** Modify your rule or test-case if existing test-cases failed. + +**Related issue(s):** [RFC25](https://github.com/eslint/rfcs/blob/master/designs/2019-rule-tester-improvements/README.md), [#12096](https://github.com/eslint/eslint/pull/12096), [#12955](https://github.com/eslint/eslint/pull/12955) + +## `CLIEngine` class has been deprecated -[`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint). +[`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class). -Because `CLIEngine` class provides synchronous API and we have a bundle of impossible features on the synchronous API. For example, parallel linting, ES modules, and printing progress. Therefore, new `ESLint` class provides only asynchronous API. `CLIEngine` class is left as-is for migration while a time. (we have not determined when we remove `CLIEngine` class yet.) +Because `CLIEngine` class provides synchronous API but we have a bundle of features that we cannot implement on the synchronous API such as parallel linting, ES modules, and printing progress. Therefore, the new `ESLint` class provides only asynchronous API and we deprecate `CLIEngine` class. **To address:** Use `ESLint` class if you are using `CLIEngine` class. The `ESLint` class has similar methods: -- `CLIEngine#addPlugin()` → `plugins` constructor option -- `CLIEngine#executeOnText()` → `ESLint#lintText()` -- `CLIEngine#executeOnFiles()` → `ESLint#lintFiles()` -- `CLIEngine#getConfigForFile()` → `ESLint#getConfigForFile()` -- `CLIEngine#getRules()` → `ESLint#getRulesForFile()` -- `CLIEngine#isPathIgnored()` → `ESLint#isPathIgnored()` -- `CLIEngine#resolveFileGlobPatterns()` → (removed) -- `CLIEngine.getFormatter()` → `ESLint#getFormatter()` -- `CLIEngine.getErrorResults()` → `ESLint.getErrorResults()` -- `CLIEngine.outputFixes()` → `ESLint.outputFixes()` - -**Related issue(s):** RFC40 (TODO: link) +| `CLIEngine` | `ESLint` | +| :------------------------------------------- | :--------------------------------- | +| `executeOnFiles(patterns)` | `lintFiles(patterns)` | +| `executeOnText(text, filePath, warnIgnored)` | `lintText(text, options)` | +| `getFormatter(name)` | `loadFormatter(name)` | +| `getConfigForFile(filePath)` | `calculateConfigForFile(filePath)` | +| `isPathIgnored(filePath)` | `isPathIgnored(filePath)` | +| `static outputFixes(results)` | `static outputFixes(results)` | +| `static getErrorResults(results)` | `static getErrorResults(results)` | +| `static getFormatter(name)` | (removed ※1) | +| `addPlugin(pluginId, definition)` | the `plugins` constructor option | +| `getRules()` | (not implemented yet) | +| `resolveFileGlobPatterns()` | (removed ※2) | + +- ※1 The `engine.getFormatter()` method had returned the object of loaded packages as-is. It had made hard to add new features to formatters for backward compatibility of third-party formatters. So the new `eslint.loadFormatter()` method returns the adapter object that wraps the object of loaded packages. It will ease adding new features as being able to provide default stuff. The adapter object may access to `ESLint` instance to make default stuff (for example, it uses loaded plugin rules to make `rulesMeta`). Therefore, `ESLint` class doesn't have the static version of `loadFormatter()` method. +- ※2 Since ESLint 6, ESLint uses a different logic from the `resolveFileGlobPatterns()` method to iterate files. Therefore, we obsolate it. + +**Related issue(s):** [RFC40](https://github.com/eslint/rfcs/blob/master/designs/2019-move-to-async-api/README.md), [#12939](https://github.com/eslint/eslint/pull/12939) From 3b5016aa7eaa7d19851c345f39d1f8c90324495a Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 19:25:25 +0900 Subject: [PATCH 03/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 6b5094cbf88..06e89a6fbbf 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -9,7 +9,7 @@ The lists below are ordered roughly by the number of users each change is expect ### Breaking changes for users - [Node.js 8 is no longer supported](#drop-node-8) -- [Lint the files that match to `overrides[].files` by default](#additional-lint-targets) +- [Lint files matched by `overrides[].files` by default](#additional-lint-targets) - [The base path of `overrides` and `ignorePatterns` is changed if the config file is given by the `--config`/`--ignore-path` options](#base-path-change) - [The place where ESLint loads plugins from is changed](#plugin-loading-change) - [Runtime deprecation warnings on `~/.eslintrc.*` config files](#runtime-deprecation-on-personal-config-files) From 9740e617e7c56f75c597a981c54332abd9849968 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 19:26:32 +0900 Subject: [PATCH 04/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 06e89a6fbbf..27cbdb61b93 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -16,7 +16,7 @@ The lists below are ordered roughly by the number of users each change is expect - [Default ignore patterns are changed](#default-ignore-patterns) - [Description in directive comments](#description-in-directive-comments) - [Node.js/CommonJS rules are deprecated](#deprecate-node-rules) -- [Several rules get strict](#rules-strict) +- [Several rules have been updated to cover more cases](#rules-strict) - [`eslint:recommended` is updated](#eslint-recommended) ### Breaking changes for plugin developers From 32ed0319cd3ef04652f798a79128a63e20373b3f Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 19:27:26 +0900 Subject: [PATCH 05/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 27cbdb61b93..a676c725f57 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -17,7 +17,7 @@ The lists below are ordered roughly by the number of users each change is expect - [Description in directive comments](#description-in-directive-comments) - [Node.js/CommonJS rules are deprecated](#deprecate-node-rules) - [Several rules have been updated to cover more cases](#rules-strict) -- [`eslint:recommended` is updated](#eslint-recommended) +- [`eslint:recommended` has been updated](#eslint-recommended) ### Breaking changes for plugin developers From aabef130b720a0d490e8508e99f4d6645a9ebec0 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 19:27:59 +0900 Subject: [PATCH 06/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index a676c725f57..3c266c2f9a7 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -13,7 +13,7 @@ The lists below are ordered roughly by the number of users each change is expect - [The base path of `overrides` and `ignorePatterns` is changed if the config file is given by the `--config`/`--ignore-path` options](#base-path-change) - [The place where ESLint loads plugins from is changed](#plugin-loading-change) - [Runtime deprecation warnings on `~/.eslintrc.*` config files](#runtime-deprecation-on-personal-config-files) -- [Default ignore patterns are changed](#default-ignore-patterns) +- [Default ignore patterns have changed](#default-ignore-patterns) - [Description in directive comments](#description-in-directive-comments) - [Node.js/CommonJS rules are deprecated](#deprecate-node-rules) - [Several rules have been updated to cover more cases](#rules-strict) From 87da93bc71ce6619cc82a6863d091e7798e88984 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 19:29:23 +0900 Subject: [PATCH 07/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 3c266c2f9a7..525011e77fa 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -12,7 +12,7 @@ The lists below are ordered roughly by the number of users each change is expect - [Lint files matched by `overrides[].files` by default](#additional-lint-targets) - [The base path of `overrides` and `ignorePatterns` is changed if the config file is given by the `--config`/`--ignore-path` options](#base-path-change) - [The place where ESLint loads plugins from is changed](#plugin-loading-change) -- [Runtime deprecation warnings on `~/.eslintrc.*` config files](#runtime-deprecation-on-personal-config-files) +- [Runtime deprecation warnings for `~/.eslintrc.*` config files](#runtime-deprecation-on-personal-config-files) - [Default ignore patterns have changed](#default-ignore-patterns) - [Description in directive comments](#description-in-directive-comments) - [Node.js/CommonJS rules are deprecated](#deprecate-node-rules) From 76ba496eded4d643883f95a52bf1e512c5d0ac31 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 19:51:27 +0900 Subject: [PATCH 08/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 525011e77fa..55dfe099cf3 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -22,7 +22,7 @@ The lists below are ordered roughly by the number of users each change is expect ### Breaking changes for plugin developers - [Node.js 8 is no longer supported](#drop-node-8) -- [Lint the files that match to `overrides[].files` by default](#additional-lint-targets) +- [Lint files matched by `overrides[].files` by default](#additional-lint-targets) - [The place where ESLint loads plugins from is changed](#plugin-loading-change) - [`RuleTester` class get strict](#rule-tester-strict) From 4080ee93ffa958b42a254a0eca84abefa487e785 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 19:51:47 +0900 Subject: [PATCH 09/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 55dfe099cf3..fd0bfea990e 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -23,7 +23,7 @@ The lists below are ordered roughly by the number of users each change is expect - [Node.js 8 is no longer supported](#drop-node-8) - [Lint files matched by `overrides[].files` by default](#additional-lint-targets) -- [The place where ESLint loads plugins from is changed](#plugin-loading-change) +- [Plugin resolution has been updated](#plugin-loading-change) - [`RuleTester` class get strict](#rule-tester-strict) ### Breaking changes for integration developers From 6ec54c7a0aa94c55e939c6d11390bfb2710f6eff Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 19:52:16 +0900 Subject: [PATCH 10/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index fd0bfea990e..e0c343b94c2 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -24,7 +24,7 @@ The lists below are ordered roughly by the number of users each change is expect - [Node.js 8 is no longer supported](#drop-node-8) - [Lint files matched by `overrides[].files` by default](#additional-lint-targets) - [Plugin resolution has been updated](#plugin-loading-change) -- [`RuleTester` class get strict](#rule-tester-strict) +- [Additional validation added to the `RuleTester` class](#rule-tester-strict) ### Breaking changes for integration developers From 846914953aa20dc10b908baaa08576aa92f1b184 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 19:52:38 +0900 Subject: [PATCH 11/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index e0c343b94c2..2c65cecdda4 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -29,7 +29,7 @@ The lists below are ordered roughly by the number of users each change is expect ### Breaking changes for integration developers - [Node.js 8 is no longer supported](#drop-node-8) -- [The place where ESLint loads plugins from is changed](#plugin-loading-change) +- [Plugin resolution has been updated](#plugin-loading-change) - [`CLIEngine` class has been deprecated](#deprecate-cliengine) --- From 4de45efd792fc56d018d1804ca3f095203be1e9e Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:00:25 +0900 Subject: [PATCH 12/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 2c65cecdda4..5e2a444cce4 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -30,7 +30,7 @@ The lists below are ordered roughly by the number of users each change is expect - [Node.js 8 is no longer supported](#drop-node-8) - [Plugin resolution has been updated](#plugin-loading-change) -- [`CLIEngine` class has been deprecated](#deprecate-cliengine) +- [The `CLIEngine` class has been deprecated](#deprecate-cliengine) --- From 22f3c7f83d5ff7af81de9e2a9b58589de56f03da Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:01:05 +0900 Subject: [PATCH 13/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 5e2a444cce4..0a7a08c362f 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -36,7 +36,7 @@ The lists below are ordered roughly by the number of users each change is expect ## Node.js 8 is no longer supported -Node.js 8 has been at EOL since December 2019. Therefore, we have decided to drop support for it in ESLint 7. We now support the following versions of Node.js: +Node.js 8 reached EOL in December 2019, and we are officially dropping support for it in this release. ESLint now supports the following versions of Node.js: - Node.js 10 (`10.12.0` and above) - Anything above Node.js 12 From 8c0976d1091c4374d6a211c090b0c720cf96f18e Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:05:46 +0900 Subject: [PATCH 14/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 0a7a08c362f..4e36619876e 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -39,7 +39,7 @@ The lists below are ordered roughly by the number of users each change is expect Node.js 8 reached EOL in December 2019, and we are officially dropping support for it in this release. ESLint now supports the following versions of Node.js: - Node.js 10 (`10.12.0` and above) -- Anything above Node.js 12 +- Node.js 12 and above **To address:** Make sure you upgrade to at least Node.js `10.12.0` when using ESLint 7. Mind the Node.js version of your editor when you use ESLint 7 via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 6 until you are able to upgrade Node.js. From 2116525c2fd93a0081c453d660a8f07c22464063 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:18:33 +0900 Subject: [PATCH 15/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 4e36619876e..0383dac3db6 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -41,7 +41,7 @@ Node.js 8 reached EOL in December 2019, and we are officially dropping support f - Node.js 10 (`10.12.0` and above) - Node.js 12 and above -**To address:** Make sure you upgrade to at least Node.js `10.12.0` when using ESLint 7. Mind the Node.js version of your editor when you use ESLint 7 via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 6 until you are able to upgrade Node.js. +**To address:** Make sure you upgrade to at least Node.js `10.12.0` when using ESLint 7. One important thing to double check is the Node.js version supported by your editor when using ESLint via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 6 until you are able to upgrade Node.js. **Related issue(s):** [RFC44](https://github.com/eslint/rfcs/blob/master/designs/2019-drop-node8/README.md), [#12700](https://github.com/eslint/eslint/pull/12700) From e8f39f1b8c7eb8b390884b1b1c2bfbea98965c91 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:20:12 +0900 Subject: [PATCH 16/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 0383dac3db6..aed21ff396f 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -212,7 +212,7 @@ The `RuleTester` now recognizes more mistakes: [`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class). -Because `CLIEngine` class provides synchronous API but we have a bundle of features that we cannot implement on the synchronous API such as parallel linting, ES modules, and printing progress. Therefore, the new `ESLint` class provides only asynchronous API and we deprecate `CLIEngine` class. +The `CLIEngine` class provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shared configs, parsers, plugins, and formatters, and adding the abilitiy to visually display the progress of linting runs. The new `ESLint` class provides an asynchronous API that ESLint core will now using going forward. `CLIEngine` will remain in core for the foreseeable future but may be removed in a future major version. **To address:** Use `ESLint` class if you are using `CLIEngine` class. The `ESLint` class has similar methods: From ce84f5f8ce0ebe0dded37bfc511b893e8c8d9680 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:20:44 +0900 Subject: [PATCH 17/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index aed21ff396f..bae4dd144f0 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -214,7 +214,7 @@ The `RuleTester` now recognizes more mistakes: The `CLIEngine` class provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shared configs, parsers, plugins, and formatters, and adding the abilitiy to visually display the progress of linting runs. The new `ESLint` class provides an asynchronous API that ESLint core will now using going forward. `CLIEngine` will remain in core for the foreseeable future but may be removed in a future major version. -**To address:** Use `ESLint` class if you are using `CLIEngine` class. The `ESLint` class has similar methods: +**To address:** Update your code to use the new `ESLint` class if you are currently using `CLIEngine`. The following table maps the existing `CLIEngine` methods to their `ESLint` counterparts: | `CLIEngine` | `ESLint` | | :------------------------------------------- | :--------------------------------- | From 0aa62956fb542a7869351064ee1c3b356b6b42b8 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:21:06 +0900 Subject: [PATCH 18/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index bae4dd144f0..335801834f1 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -45,7 +45,7 @@ Node.js 8 reached EOL in December 2019, and we are officially dropping support f **Related issue(s):** [RFC44](https://github.com/eslint/rfcs/blob/master/designs/2019-drop-node8/README.md), [#12700](https://github.com/eslint/eslint/pull/12700) -## Lint the files that match to `overrides[].files` by default +## Lint files matched by `overrides[].files` by default Previously, ESLint lints only `*.js` files by default if directories are present such as below. From 32e09d9c8a3decf3c48d89ce89f83d8e36e1a8cd Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:22:01 +0900 Subject: [PATCH 19/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 335801834f1..8d2b63b8d68 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -47,7 +47,7 @@ Node.js 8 reached EOL in December 2019, and we are officially dropping support f ## Lint files matched by `overrides[].files` by default -Previously, ESLint lints only `*.js` files by default if directories are present such as below. +Previously to v7.0.0, ESLint would only lint files with a `.js` extension by default. ``` $ eslint src From 2fe97f28ac1b1f30829bab8e5872dc505804b878 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:23:39 +0900 Subject: [PATCH 20/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 8d2b63b8d68..966a12a177f 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -53,7 +53,7 @@ Previously to v7.0.0, ESLint would only lint files with a `.js` extension by def $ eslint src ``` -In the situation, ESLint 7 lints the files that match to `overrides[].files` along with `*.js` files. (But it excepts patterns that end with `*` in order to avoid linting unlimitedly.) For example, if the following config file is present, +ESLint 7.0.0 will now additionally lint files with other extensions (`.ts`, `.vue`, etc.) if the extension is explicitly matched by an `overrides[].files` entry. This will allow for users to lint files that don't end with `*.js` to be linted without having to use the `--ext` command line flag, as well as allow shared configuration authors to enable linting of these files without additional overhead for the end user. Please note that patterns that end with `*` are exempt from this behavior and will behave as they did previously. For example, if the following config file is present, ```yml # .eslintrc.yml From a6d1270a183ba789ec09b9549eb46f905a816320 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:24:08 +0900 Subject: [PATCH 21/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 966a12a177f..1164e6bcf58 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -63,7 +63,7 @@ overrides: extends: my-config-ts ``` -then the `eslint src` command checks both `*.js` and `*.ts` files in the `src` directory. +then running `eslint src` would check both `*.js` and `*.ts` files in the `src` directory. **To address:** Add `--ext js` option if you are using `overrides` but don't want to lint other files than `*.js`. The `--ext` CLI option overrides this new behavior completely. From ae688b8d4a990e8cfd6aac1ae339efab22460b92 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:25:17 +0900 Subject: [PATCH 22/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 1164e6bcf58..9bb88b97120 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -65,7 +65,7 @@ overrides: then running `eslint src` would check both `*.js` and `*.ts` files in the `src` directory. -**To address:** Add `--ext js` option if you are using `overrides` but don't want to lint other files than `*.js`. The `--ext` CLI option overrides this new behavior completely. +**To address:** Using the `--ext` CLI option will override this new behavior. Run ESLint with `--ext .js` if you are using `overrides` but only want to lint files that have a `.js` extension. If you maintain plugins which check other kinds of files than `.js`, it may be convenient if the `recommended` preset of your plugin has the `overrides` setting in order to check the files by default. From 1a5e56314f0d51d54da38da9201386f0ce2ca229 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:26:25 +0900 Subject: [PATCH 23/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 9bb88b97120..173994d404c 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -67,7 +67,7 @@ then running `eslint src` would check both `*.js` and `*.ts` files in the `src` **To address:** Using the `--ext` CLI option will override this new behavior. Run ESLint with `--ext .js` if you are using `overrides` but only want to lint files that have a `.js` extension. -If you maintain plugins which check other kinds of files than `.js`, it may be convenient if the `recommended` preset of your plugin has the `overrides` setting in order to check the files by default. +If you maintain plugins that check files with extensions other than `.js`, this feature will allow you to check these files by default by configuring an `overrides` setting in your `recommended` preset. **Related issue(s):** [RFC20](https://github.com/eslint/rfcs/blob/master/designs/2019-additional-lint-targets/README.md), [#12677](https://github.com/eslint/eslint/pull/12677) From b21a264f1a7c539406b9afd1a63fdf8aeb3bddf9 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:27:00 +0900 Subject: [PATCH 24/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 173994d404c..2c96563e5b3 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -71,7 +71,7 @@ If you maintain plugins that check files with extensions other than `.js`, this **Related issue(s):** [RFC20](https://github.com/eslint/rfcs/blob/master/designs/2019-additional-lint-targets/README.md), [#12677](https://github.com/eslint/eslint/pull/12677) -## The base path of `overrides` and `ignorePatterns` is changed if the config file is given by the `--config`/`--ignore-path` options +## The base path of `overrides` and `ignorePatterns` has changed when using the `--config`/`--ignore-path` options ESLint resolves the following paths as relative to the directory path of having the _entry_ config file. (the _entry_ means that the settings of shareable configs are resolved as relative to the directory of having the first extender.) From 9d86cbd9eb350b0fed570b4d8887e3d3c95aea6b Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:28:08 +0900 Subject: [PATCH 25/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 2c96563e5b3..db17c264d69 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -73,7 +73,7 @@ If you maintain plugins that check files with extensions other than `.js`, this ## The base path of `overrides` and `ignorePatterns` has changed when using the `--config`/`--ignore-path` options -ESLint resolves the following paths as relative to the directory path of having the _entry_ config file. (the _entry_ means that the settings of shareable configs are resolved as relative to the directory of having the first extender.) +Up until now, ESLint has resolved the following paths relative to the directory path of the _entry_ configuration file: - Configuration files (`.eslintrc.*`) - relative paths in the `overrides[].files` setting From 213d18a4e8c1d374317210c4a64ac0f3a1436d03 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 20:29:16 +0900 Subject: [PATCH 26/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index db17c264d69..024ac43f10b 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -82,7 +82,7 @@ Up until now, ESLint has resolved the following paths relative to the directory - Ignore files (`.eslintignore`) - paths which start with `/` -ESLint 7 keeps this behavior in most cases, but only if the config file is given via either `--config path/to/a-config` or `--ignore-path path/to/a-ignore` options then ESLint resolves those paths as relative to the current working directory rather than the file location. +Starting in ESLint v7, configuration files and ignore files passed to ESLint using the `--config path/to/a-config` and `--ignore-path path/to/a-ignore` CLI flags, respectively, will resolve from the current working directory rather than the file location. This allows for users to utilize shared plugins without having to install them directly in their project. **To address:** Update those paths if you are using the config file via `--config` or `--ignore-path` CLI options. From 4f16d15f1f58989e38c6e601b509d09e057d3741 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:11:39 +0900 Subject: [PATCH 27/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 024ac43f10b..e59f145033c 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -84,7 +84,7 @@ Up until now, ESLint has resolved the following paths relative to the directory Starting in ESLint v7, configuration files and ignore files passed to ESLint using the `--config path/to/a-config` and `--ignore-path path/to/a-ignore` CLI flags, respectively, will resolve from the current working directory rather than the file location. This allows for users to utilize shared plugins without having to install them directly in their project. -**To address:** Update those paths if you are using the config file via `--config` or `--ignore-path` CLI options. +**To address:** Update the affected paths if you are using a configuration or ignore file via the `--config` or `--ignore-path` CLI options. **Related issue(s):** [RFC37](https://github.com/eslint/rfcs/blob/master/designs/2019-changing-base-path-in-config-files-that-cli-options-specify/README.md), [#12887](https://github.com/eslint/eslint/pull/12887) From 5c6267dff53ecd9d7d9a6a6e04df5f613c21810c Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:12:06 +0900 Subject: [PATCH 28/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index e59f145033c..ab1abeae624 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -88,7 +88,7 @@ Starting in ESLint v7, configuration files and ignore files passed to ESLint usi **Related issue(s):** [RFC37](https://github.com/eslint/rfcs/blob/master/designs/2019-changing-base-path-in-config-files-that-cli-options-specify/README.md), [#12887](https://github.com/eslint/eslint/pull/12887) -## The place where ESLint loads plugins from is changed +## Plugin resolution has been updated Previously, ESLint resolves all plugins from the current working directory by default. From 29c240c298630da38c9055ad8f75814f68e52c6d Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:12:47 +0900 Subject: [PATCH 29/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index ab1abeae624..db47092dd1f 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -90,7 +90,7 @@ Starting in ESLint v7, configuration files and ignore files passed to ESLint usi ## Plugin resolution has been updated -Previously, ESLint resolves all plugins from the current working directory by default. +In previous versions, ESLint resolved all plugins from the current working directory by default. Since ESLint 7, it resolves the `plugins` setting as relative to the directory of having the _entry_ config file. (the _entry_ means that the `plugins` setting of shareable configs is resolved as relative to the directory of having the first extender.) From cdb1388649050faa6be9511f37754c6b0e173f2c Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:13:43 +0900 Subject: [PATCH 30/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index db47092dd1f..e0037742876 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -92,7 +92,7 @@ Starting in ESLint v7, configuration files and ignore files passed to ESLint usi In previous versions, ESLint resolved all plugins from the current working directory by default. -Since ESLint 7, it resolves the `plugins` setting as relative to the directory of having the _entry_ config file. (the _entry_ means that the `plugins` setting of shareable configs is resolved as relative to the directory of having the first extender.) +Starting in ESLint 7.0.0, `plugins` are resolved relative to the directory path of the _entry_ configuration file. This will not change anything in most cases. If a config file in a subdirectory has `plugins` setting, the plugins will be loaded from the subdirectory (or ancestor directories that include the current working directory if not found). From 7b8f55318d4678b929aa4577ce53b2bdcc4f218c Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:14:39 +0900 Subject: [PATCH 31/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index e0037742876..11572614eb5 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -94,7 +94,7 @@ In previous versions, ESLint resolved all plugins from the current working direc Starting in ESLint 7.0.0, `plugins` are resolved relative to the directory path of the _entry_ configuration file. -This will not change anything in most cases. If a config file in a subdirectory has `plugins` setting, the plugins will be loaded from the subdirectory (or ancestor directories that include the current working directory if not found). +This will not change anything in most cases. If a configuration file in a subdirectory has `plugins` defined, the plugins will be loaded from the subdirectory (or ancestor directories that include the current working directory if not found). If you are using a config file of a shared location via `--config` option, the plugins the config file declare will be loaded from the shared location. From 718863de5d445f858926e3823d3c0141b076f15a Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:15:31 +0900 Subject: [PATCH 32/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 11572614eb5..5f03565ca58 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -96,7 +96,7 @@ Starting in ESLint 7.0.0, `plugins` are resolved relative to the directory path This will not change anything in most cases. If a configuration file in a subdirectory has `plugins` defined, the plugins will be loaded from the subdirectory (or ancestor directories that include the current working directory if not found). -If you are using a config file of a shared location via `--config` option, the plugins the config file declare will be loaded from the shared location. +This means that if you are using a config file from a shared location via `--config` option, the plugins that the config file declare will be loaded from the shared config file location. **To address:** Install plugins to the proper place or add `--resolve-plugins-relative-to .` option to override this change. From ce1fb8fb80ebcf44831ccc23e38d89042804bb72 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:16:08 +0900 Subject: [PATCH 33/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 5f03565ca58..5601fbef93b 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -98,7 +98,7 @@ This will not change anything in most cases. If a configuration file in a subdir This means that if you are using a config file from a shared location via `--config` option, the plugins that the config file declare will be loaded from the shared config file location. -**To address:** Install plugins to the proper place or add `--resolve-plugins-relative-to .` option to override this change. +**To address:** Ensure that plugins are installed in a place that can be resolved relative to your configuration file or use `--resolve-plugins-relative-to .` to override this change. **Related issue(s):** [RFC47](https://github.com/eslint/rfcs/blob/master/designs/2019-plugin-loading-improvement/README.md), [#12922](https://github.com/eslint/eslint/pull/12922) From b5ed9cc8604198be307e3fc29245dbc66449c5e7 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:17:09 +0900 Subject: [PATCH 34/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 5601fbef93b..398440279a1 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -102,7 +102,7 @@ This means that if you are using a config file from a shared location via `--con **Related issue(s):** [RFC47](https://github.com/eslint/rfcs/blob/master/designs/2019-plugin-loading-improvement/README.md), [#12922](https://github.com/eslint/eslint/pull/12922) -## Runtime deprecation warnings on `~/.eslintrc.*` config files +## Runtime deprecation warnings for `~/.eslintrc.*` config files Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). As planned, v7.0.0 has started to print runtime deprecation warnings. It prints the warnings when the following situations: From d71788f2e480cf38ee636270cd41cf5d8618f87e Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:17:50 +0900 Subject: [PATCH 35/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 398440279a1..231503bbb81 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -104,7 +104,7 @@ This means that if you are using a config file from a shared location via `--con ## Runtime deprecation warnings for `~/.eslintrc.*` config files -Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). As planned, v7.0.0 has started to print runtime deprecation warnings. It prints the warnings when the following situations: +Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). ESLint 7.0.0 will start printing runtime deprecation warnings. It will print a warning for the following situations: 1. When ESLint loaded `~/.eslintrc.*` config files because project's config was not present. 1. When ESLint ignored `~/.eslintrc.*` config files because project's config was present. (in other words, the HOME directory is an ancestor directory of the project and the project config didn't have `root:true` setting.) From e18322d0afe5874bebdd6435789c37638bf8ab68 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:18:33 +0900 Subject: [PATCH 36/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 231503bbb81..8340a222ca2 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -106,7 +106,7 @@ This means that if you are using a config file from a shared location via `--con Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). ESLint 7.0.0 will start printing runtime deprecation warnings. It will print a warning for the following situations: -1. When ESLint loaded `~/.eslintrc.*` config files because project's config was not present. +1. When a project does not have a configuration file present and ESLint loads configuration from `~/.eslintrc.*`. 1. When ESLint ignored `~/.eslintrc.*` config files because project's config was present. (in other words, the HOME directory is an ancestor directory of the project and the project config didn't have `root:true` setting.) **To address:** Remove `~/.eslintrc.*` config files then add `.eslintrc.*` config files to your project directory. Or use `--config` option to use shared config files. From 6beeafd2c95d6372eafa9902498d0f17784c2705 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:20:21 +0900 Subject: [PATCH 37/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 8340a222ca2..2f300ced870 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -107,7 +107,7 @@ This means that if you are using a config file from a shared location via `--con Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). ESLint 7.0.0 will start printing runtime deprecation warnings. It will print a warning for the following situations: 1. When a project does not have a configuration file present and ESLint loads configuration from `~/.eslintrc.*`. -1. When ESLint ignored `~/.eslintrc.*` config files because project's config was present. (in other words, the HOME directory is an ancestor directory of the project and the project config didn't have `root:true` setting.) +1. When a project has a configuration file and ESLint ignored a `~/.eslintrc.*` configuration file. This occurs when the `$HOME` directory is an ancestor directory of the project and the project's configuration files doesn't contain `root:true`. **To address:** Remove `~/.eslintrc.*` config files then add `.eslintrc.*` config files to your project directory. Or use `--config` option to use shared config files. From 1e9ffbb1cbf15f76e29ccb7b595f17c087d15bc7 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:21:06 +0900 Subject: [PATCH 38/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 2f300ced870..2a6612f323a 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -109,7 +109,7 @@ Personal config files have been deprecated since [v6.7.0](https://eslint.org/blo 1. When a project does not have a configuration file present and ESLint loads configuration from `~/.eslintrc.*`. 1. When a project has a configuration file and ESLint ignored a `~/.eslintrc.*` configuration file. This occurs when the `$HOME` directory is an ancestor directory of the project and the project's configuration files doesn't contain `root:true`. -**To address:** Remove `~/.eslintrc.*` config files then add `.eslintrc.*` config files to your project directory. Or use `--config` option to use shared config files. +**To address:** Remove `~/.eslintrc.*` configuration files and add a `.eslintrc.*` configuration file to your project. Alternatively, use the `--config` option to use shared config files. **Related issue(s):** [RFC32](https://github.com/eslint/rfcs/tree/master/designs/2019-deprecating-personal-config/README.md), [#12678](https://github.com/eslint/eslint/pull/12678) From c7df68efe311b1683d970c5a8083f3450cc52dd5 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:21:31 +0900 Subject: [PATCH 39/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 2a6612f323a..6a3def5fa6e 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -113,7 +113,7 @@ Personal config files have been deprecated since [v6.7.0](https://eslint.org/blo **Related issue(s):** [RFC32](https://github.com/eslint/rfcs/tree/master/designs/2019-deprecating-personal-config/README.md), [#12678](https://github.com/eslint/eslint/pull/12678) -## Default ignore patterns are changed +## Default ignore patterns have changed Previously, ESLint ignores the following files: From a72e330c8ddbe9c830a975e23cd6a3b1f9a8a4f3 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:22:09 +0900 Subject: [PATCH 40/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 6a3def5fa6e..41801913e2e 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -115,7 +115,7 @@ Personal config files have been deprecated since [v6.7.0](https://eslint.org/blo ## Default ignore patterns have changed -Previously, ESLint ignores the following files: +Up until now, ESLint has ignored the following files by default: - Dotfiles (`.*`) - `node_modules` in the current working directory (`/node_modules/*`) From 308ff1f6de3bed1b1d96ed0d16055d4e3c589b7a Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:22:34 +0900 Subject: [PATCH 41/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 41801913e2e..879af6ac9f0 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -130,7 +130,7 @@ ESLint 7 ignores `node_modules/*` of subdirectories as well, but no longer ignor **Related issue(s):** [RFC51](https://github.com/eslint/rfcs/blob/master/designs/2019-update-default-ignore-patterns/README.md), [#12888](https://github.com/eslint/eslint/pull/12888) -## Description in directive comments +## Descriptions in directive comments Previously, ESLint doesn't have the official way to write the reason for directive comments like `/*eslint-disable*/`, but it's better if directive comments have the reason description. From a0d11b4beceb9bbbeb6042aaa9d91f7d8f401137 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:23:24 +0900 Subject: [PATCH 42/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 879af6ac9f0..095825255e1 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -132,7 +132,7 @@ ESLint 7 ignores `node_modules/*` of subdirectories as well, but no longer ignor ## Descriptions in directive comments -Previously, ESLint doesn't have the official way to write the reason for directive comments like `/*eslint-disable*/`, but it's better if directive comments have the reason description. +In older version of ESLint, there was no convenient way to indicate why a directive comment – such as `/*eslint-disable*/` – was necessary. ESLint 7 ignores the part preceded by `--` in directive comments. For example: From 6eb6118ecc6c64fc8046fb6bf2155f4ce63e1f6b Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:24:05 +0900 Subject: [PATCH 43/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 095825255e1..d2e456d269f 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -134,7 +134,7 @@ ESLint 7 ignores `node_modules/*` of subdirectories as well, but no longer ignor In older version of ESLint, there was no convenient way to indicate why a directive comment – such as `/*eslint-disable*/` – was necessary. -ESLint 7 ignores the part preceded by `--` in directive comments. For example: +To allow for the colocation of comments that provide context with the directive, ESLint 7.0.0 adds the ability to append arbitrary text in directive comments by ignoring text following `--`. For example: ```js // eslint-disable-next-line a-rule, another-rule -- those are buggy!! From ca9fe7d756c82292e2289a419d093975d13cba56 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:24:59 +0900 Subject: [PATCH 44/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index d2e456d269f..9121beaff0f 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -140,7 +140,7 @@ To allow for the colocation of comments that provide context with the directive, // eslint-disable-next-line a-rule, another-rule -- those are buggy!! ``` -**To address:** If you have `--` surrounded by whitespaces in the configuration in directive comments, consider to move it to your config file. +**To address:** If you have `--` surrounded by whitespace in directive comments, consider moving it into your configuration file. **Related issue(s):** [RFC33](https://github.com/eslint/rfcs/blob/master/designs/2019-description-in-directive-comments/README.md), [#12699](https://github.com/eslint/eslint/pull/12699) From e0708ceca992dadeba8a31dc8882cb86f8a4f1d5 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:27:11 +0900 Subject: [PATCH 45/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 9121beaff0f..da4b73a59ea 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -144,7 +144,7 @@ To allow for the colocation of comments that provide context with the directive, **Related issue(s):** [RFC33](https://github.com/eslint/rfcs/blob/master/designs/2019-description-in-directive-comments/README.md), [#12699](https://github.com/eslint/eslint/pull/12699) -## Node.js/CommonJS rules are deprecated +## Node.js/CommonJS rules have been deprecated Ten rules about Node.js/CommonJS are deprecated and moved to the [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) plugin. From 41d28dcc705ef554d3e0ed3c3d33c7030b81861f Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:27:54 +0900 Subject: [PATCH 46/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index da4b73a59ea..fa77e0494b3 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -146,7 +146,7 @@ To allow for the colocation of comments that provide context with the directive, ## Node.js/CommonJS rules have been deprecated -Ten rules about Node.js/CommonJS are deprecated and moved to the [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) plugin. +The ten Node.js/CommonJS rules in core have been deprecated and moved to the [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) plugin. **To address:** As [our deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), you can continue to use the deprecated rules. But the source code of the deprecated rules has been frozen, so we don't fix any bugs of those rules anymore. Therefore, we recommend using the corresponded plugin rules instead. From 8561dfae97ff1b58ebfb278bb17849b92b250bc7 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:28:52 +0900 Subject: [PATCH 47/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index fa77e0494b3..bbbf999dacb 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -148,7 +148,7 @@ To allow for the colocation of comments that provide context with the directive, The ten Node.js/CommonJS rules in core have been deprecated and moved to the [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) plugin. -**To address:** As [our deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), you can continue to use the deprecated rules. But the source code of the deprecated rules has been frozen, so we don't fix any bugs of those rules anymore. Therefore, we recommend using the corresponded plugin rules instead. +**To address:** As per [our deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), the deprecated rules will remain in core for the foreseeable future and are still available for use. However, we will no longer be updating or fixing any bugs in those rules. To use a supported version of the rules, we recommend using the corresponding rules in the plugin instead. | Deprecated Rules | Alternative | | :--------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ | From 299ca1fbfaa6948021c19e2ebf2b93100075416d Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:29:52 +0900 Subject: [PATCH 48/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index bbbf999dacb..3db3901f019 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -150,7 +150,7 @@ The ten Node.js/CommonJS rules in core have been deprecated and moved to the [es **To address:** As per [our deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), the deprecated rules will remain in core for the foreseeable future and are still available for use. However, we will no longer be updating or fixing any bugs in those rules. To use a supported version of the rules, we recommend using the corresponding rules in the plugin instead. -| Deprecated Rules | Alternative | +| Deprecated Rules | Replacement | | :--------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ | | [callback-return](https://eslint.org/docs/rules/callback-return) | [node/callback-return](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/callback-return.md) | | [global-require](https://eslint.org/docs/rules/global-require) | [node/global-require](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/global-require.md) | From 7dd1c5ec620bf158c0c469dbe50631562e72e017 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:30:23 +0900 Subject: [PATCH 49/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 3db3901f019..8ff10dadcca 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -165,7 +165,7 @@ The ten Node.js/CommonJS rules in core have been deprecated and moved to the [es **Related issue(s):** [#12898](https://github.com/eslint/eslint/pull/12898) -## Several rules get strict +## Several rules have been updated to cover more cases Several rules now report more errors as enhancement: From 78108d50d8b8331724ac47104a0453c74a2064eb Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:30:56 +0900 Subject: [PATCH 50/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 8ff10dadcca..a3fba1f7698 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -167,7 +167,7 @@ The ten Node.js/CommonJS rules in core have been deprecated and moved to the [es ## Several rules have been updated to cover more cases -Several rules now report more errors as enhancement: +Several rules have been enhanced and now report additional errors: - [accessor-pairs](https://eslint.org/docs/rules/accessor-pairs) rule now recognizes class members by default. - [array-callback-return](https://eslint.org/docs/rules/array-callback-return) rule now recognizes `flatMap` method. From 50ac7061cfe40bc88117d9974ebeceef1f66e335 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:31:57 +0900 Subject: [PATCH 51/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index a3fba1f7698..24fe2c3db25 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -174,7 +174,7 @@ Several rules have been enhanced and now report additional errors: - [computed-property-spacing](https://eslint.org/docs/rules/computed-property-spacing) rule now recognizes class members by default. - [func-names](https://eslint.org/docs/rules/func-names) rule now recognizes function declarations in default exports. - [no-extra-parens](https://eslint.org/docs/rules/no-extra-parens) rule now recognizes parentheses in assignment targets. -- [no-dupe-class-members](https://eslint.org/docs/rules/no-dupe-class-members) rule now recognizes computed keys if it's static. +- [no-dupe-class-members](https://eslint.org/docs/rules/no-dupe-class-members) rule now recognizes computed keys for static class members. - [no-magic-number](https://eslint.org/docs/rules/no-magic-number) rule now recognizes bigint literals. - [radix](https://eslint.org/docs/rules/radix) rule now recognizes invalid numbers at the second parameter of `parseInt()`. - [use-isnan](https://eslint.org/docs/rules/use-isnan) rule now recognizes class members by default. From 70f15aaa4a8da1528bf4073655db90e23fef0c6a Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:32:26 +0900 Subject: [PATCH 52/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 24fe2c3db25..04d54842e8a 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -176,7 +176,7 @@ Several rules have been enhanced and now report additional errors: - [no-extra-parens](https://eslint.org/docs/rules/no-extra-parens) rule now recognizes parentheses in assignment targets. - [no-dupe-class-members](https://eslint.org/docs/rules/no-dupe-class-members) rule now recognizes computed keys for static class members. - [no-magic-number](https://eslint.org/docs/rules/no-magic-number) rule now recognizes bigint literals. -- [radix](https://eslint.org/docs/rules/radix) rule now recognizes invalid numbers at the second parameter of `parseInt()`. +- [radix](https://eslint.org/docs/rules/radix) rule now recognizes invalid numbers for the second parameter of `parseInt()`. - [use-isnan](https://eslint.org/docs/rules/use-isnan) rule now recognizes class members by default. - [yoda](https://eslint.org/docs/rules/yoda) rule now recognizes bigint literals. From 93a025d5ff08cf5b8421a0fbd2a3a5b423d26a52 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:32:57 +0900 Subject: [PATCH 53/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 04d54842e8a..394a6c85c56 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -180,7 +180,7 @@ Several rules have been enhanced and now report additional errors: - [use-isnan](https://eslint.org/docs/rules/use-isnan) rule now recognizes class members by default. - [yoda](https://eslint.org/docs/rules/yoda) rule now recognizes bigint literals. -**To address:** Modify your code if new warnings appeared. +**To address:** Fix errors or use directive comments to disable the rules. **Related issue(s):** [#12490](https://github.com/eslint/eslint/pull/12490), [#12608](https://github.com/eslint/eslint/pull/12608), [#12670](https://github.com/eslint/eslint/pull/12670), [#12701](https://github.com/eslint/eslint/pull/12701), [#12765](https://github.com/eslint/eslint/pull/12765), [#12837](https://github.com/eslint/eslint/pull/12837), [#12913](https://github.com/eslint/eslint/pull/12913), [#12915](https://github.com/eslint/eslint/pull/12915), [#12919](https://github.com/eslint/eslint/pull/12919) From 18827145ba63427069ee512191141af4931718ba Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:33:29 +0900 Subject: [PATCH 54/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 394a6c85c56..8eded668b34 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -184,7 +184,7 @@ Several rules have been enhanced and now report additional errors: **Related issue(s):** [#12490](https://github.com/eslint/eslint/pull/12490), [#12608](https://github.com/eslint/eslint/pull/12608), [#12670](https://github.com/eslint/eslint/pull/12670), [#12701](https://github.com/eslint/eslint/pull/12701), [#12765](https://github.com/eslint/eslint/pull/12765), [#12837](https://github.com/eslint/eslint/pull/12837), [#12913](https://github.com/eslint/eslint/pull/12913), [#12915](https://github.com/eslint/eslint/pull/12915), [#12919](https://github.com/eslint/eslint/pull/12919) -## `eslint:recommended` is updated +## `eslint:recommended` has been updated Three new rules are enabled by the `eslint:recommended` preset. From ce6cd73a7efadf75ddf2e6ef594a83a47a27ec8c Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:34:04 +0900 Subject: [PATCH 55/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 8eded668b34..4567f87c43e 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -186,7 +186,7 @@ Several rules have been enhanced and now report additional errors: ## `eslint:recommended` has been updated -Three new rules are enabled by the `eslint:recommended` preset. +Three new rules have been enabled in the `eslint:recommended` preset. - [no-dupe-else-if](https://eslint.org/docs/rules/no-dupe-else-if) - [no-import-assign](https://eslint.org/docs/rules/no-import-assign) From 1088fd2e05afe006682b02cf0c1a78383d7be97a Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:34:46 +0900 Subject: [PATCH 56/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 4567f87c43e..a5661c29ea4 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -192,7 +192,7 @@ Three new rules have been enabled in the `eslint:recommended` preset. - [no-import-assign](https://eslint.org/docs/rules/no-import-assign) - [no-setter-return](https://eslint.org/docs/rules/no-setter-return) -**To address:** Modify your code if new warnings appeared. +**To address:** Fix errors or use disable these rules. **Related issue(s):** [#12920](https://github.com/eslint/eslint/pull/12920) From 0b8a188b67128490f45066f163587bb41968be5b Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:35:12 +0900 Subject: [PATCH 57/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index a5661c29ea4..cf31cfdd2e9 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -196,7 +196,7 @@ Three new rules have been enabled in the `eslint:recommended` preset. **Related issue(s):** [#12920](https://github.com/eslint/eslint/pull/12920) -## `RuleTester` class get strict +## Additional validation added to the `RuleTester` class The `RuleTester` now recognizes more mistakes: From 451bd008c8bc1953136c67a6349fb262917fab1c Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:35:44 +0900 Subject: [PATCH 58/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index cf31cfdd2e9..2c5f62761ae 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -198,7 +198,7 @@ Three new rules have been enabled in the `eslint:recommended` preset. ## Additional validation added to the `RuleTester` class -The `RuleTester` now recognizes more mistakes: +The `RuleTester` now validates the following: - It fails test-cases if the rule uses either of non-standard properties `node.start` and `node.end`. Use `node.range` instead. - It fails test-cases if the rule provides autofix but the test-case doesn't have the `output` property. Add the `output` property to test autofix. From b58b60b192e78f4c97bc5c86657df25d57e950eb Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:36:23 +0900 Subject: [PATCH 59/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 2c5f62761ae..3d61c7b5b29 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -200,7 +200,7 @@ Three new rules have been enabled in the `eslint:recommended` preset. The `RuleTester` now validates the following: -- It fails test-cases if the rule uses either of non-standard properties `node.start` and `node.end`. Use `node.range` instead. +- It fails test cases if the rule under test uses the non-standard `node.start` or `node.end` properties. Rules should use `node.range` instead. - It fails test-cases if the rule provides autofix but the test-case doesn't have the `output` property. Add the `output` property to test autofix. - It fails test-cases if any unknown properties are found in the objects in the `errors` property. From 269803b447578d59c53116913f41c197aebd51fe Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:37:05 +0900 Subject: [PATCH 60/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 3d61c7b5b29..2905dc56ab2 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -201,7 +201,7 @@ Three new rules have been enabled in the `eslint:recommended` preset. The `RuleTester` now validates the following: - It fails test cases if the rule under test uses the non-standard `node.start` or `node.end` properties. Rules should use `node.range` instead. -- It fails test-cases if the rule provides autofix but the test-case doesn't have the `output` property. Add the `output` property to test autofix. +- It fails test cases if the rule under test provides an autofix but a test case doesn't have an `output` property. Add an `output` property to test cases to test the rule's autofix functionality. - It fails test-cases if any unknown properties are found in the objects in the `errors` property. **To address:** Modify your rule or test-case if existing test-cases failed. From 2b518290a718ba82e0003e30c3863e1bc51ce724 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:37:33 +0900 Subject: [PATCH 61/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 2905dc56ab2..62669123716 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -202,7 +202,7 @@ The `RuleTester` now validates the following: - It fails test cases if the rule under test uses the non-standard `node.start` or `node.end` properties. Rules should use `node.range` instead. - It fails test cases if the rule under test provides an autofix but a test case doesn't have an `output` property. Add an `output` property to test cases to test the rule's autofix functionality. -- It fails test-cases if any unknown properties are found in the objects in the `errors` property. +- It fails test cases if any unknown properties are found in the objects in the `errors` property. **To address:** Modify your rule or test-case if existing test-cases failed. From 9ad996444219c86d3b367d0560c94bcad64f3f7c Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:38:03 +0900 Subject: [PATCH 62/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 62669123716..2521f3aec63 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -204,7 +204,7 @@ The `RuleTester` now validates the following: - It fails test cases if the rule under test provides an autofix but a test case doesn't have an `output` property. Add an `output` property to test cases to test the rule's autofix functionality. - It fails test cases if any unknown properties are found in the objects in the `errors` property. -**To address:** Modify your rule or test-case if existing test-cases failed. +**To address:** Modify your rule or test case if existing test cases fail. **Related issue(s):** [RFC25](https://github.com/eslint/rfcs/blob/master/designs/2019-rule-tester-improvements/README.md), [#12096](https://github.com/eslint/eslint/pull/12096), [#12955](https://github.com/eslint/eslint/pull/12955) From 6881d814d706116385a7b3db84e2d13bb78ccbe3 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:38:38 +0900 Subject: [PATCH 63/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 2521f3aec63..bf54538cc4c 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -210,7 +210,7 @@ The `RuleTester` now validates the following: ## `CLIEngine` class has been deprecated -[`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class). +The [`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by the new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class). The `CLIEngine` class provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shared configs, parsers, plugins, and formatters, and adding the abilitiy to visually display the progress of linting runs. The new `ESLint` class provides an asynchronous API that ESLint core will now using going forward. `CLIEngine` will remain in core for the foreseeable future but may be removed in a future major version. From 55ac0f4bb04d4599cc4ef6ef022581fcfd43615d Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:39:08 +0900 Subject: [PATCH 64/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index bf54538cc4c..6263298c330 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -208,7 +208,7 @@ The `RuleTester` now validates the following: **Related issue(s):** [RFC25](https://github.com/eslint/rfcs/blob/master/designs/2019-rule-tester-improvements/README.md), [#12096](https://github.com/eslint/eslint/pull/12096), [#12955](https://github.com/eslint/eslint/pull/12955) -## `CLIEngine` class has been deprecated +## The `CLIEngine` class has been deprecated The [`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by the new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class). From 9a63741c8310f0d05f0505ece10797773cd79a30 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:39:41 +0900 Subject: [PATCH 65/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 6263298c330..bb56c58f904 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -231,6 +231,6 @@ The `CLIEngine` class provides a synchronous API that is blocking the implementa | `resolveFileGlobPatterns()` | (removed ※2) | - ※1 The `engine.getFormatter()` method had returned the object of loaded packages as-is. It had made hard to add new features to formatters for backward compatibility of third-party formatters. So the new `eslint.loadFormatter()` method returns the adapter object that wraps the object of loaded packages. It will ease adding new features as being able to provide default stuff. The adapter object may access to `ESLint` instance to make default stuff (for example, it uses loaded plugin rules to make `rulesMeta`). Therefore, `ESLint` class doesn't have the static version of `loadFormatter()` method. -- ※2 Since ESLint 6, ESLint uses a different logic from the `resolveFileGlobPatterns()` method to iterate files. Therefore, we obsolate it. +- ※2 Since ESLint 6, ESLint uses different logic from the `resolveFileGlobPatterns()` method to iterate files, making this method obsolete. **Related issue(s):** [RFC40](https://github.com/eslint/rfcs/blob/master/designs/2019-move-to-async-api/README.md), [#12939](https://github.com/eslint/eslint/pull/12939) From 867098b6afe216d56086852f1799ae9c2a1b1e7e Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:41:09 +0900 Subject: [PATCH 66/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kai Cataldo --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index bb56c58f904..ad511b80f59 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -230,7 +230,7 @@ The `CLIEngine` class provides a synchronous API that is blocking the implementa | `getRules()` | (not implemented yet) | | `resolveFileGlobPatterns()` | (removed ※2) | -- ※1 The `engine.getFormatter()` method had returned the object of loaded packages as-is. It had made hard to add new features to formatters for backward compatibility of third-party formatters. So the new `eslint.loadFormatter()` method returns the adapter object that wraps the object of loaded packages. It will ease adding new features as being able to provide default stuff. The adapter object may access to `ESLint` instance to make default stuff (for example, it uses loaded plugin rules to make `rulesMeta`). Therefore, `ESLint` class doesn't have the static version of `loadFormatter()` method. +- ※1 The `engine.getFormatter()` method currently returns the object of loaded packages as-is, which made it difficult to add new features to formatters for backward compatibility reasons. The new `eslint.loadFormatter()` method returns an adapter object that wraps the object of loaded packages, to ease the process of adding new features. Additionally, the adapter object may has access to the `ESLint` instance to calculate default data (using loaded plugin rules to make `rulesMeta`, for example). As a result, the `ESLint` class only implements an instance version of the `loadFormatter()` method. - ※2 Since ESLint 6, ESLint uses different logic from the `resolveFileGlobPatterns()` method to iterate files, making this method obsolete. **Related issue(s):** [RFC40](https://github.com/eslint/rfcs/blob/master/designs/2019-move-to-async-api/README.md), [#12939](https://github.com/eslint/eslint/pull/12939) From 1f1d4e45c3e6503655a656c7f5e96e5e67704a2d Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:49:13 +0900 Subject: [PATCH 67/74] remove `$ eslint src` block --- docs/user-guide/migrating-to-7.0.0.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index ad511b80f59..e8e5dceb7f0 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -47,11 +47,7 @@ Node.js 8 reached EOL in December 2019, and we are officially dropping support f ## Lint files matched by `overrides[].files` by default -Previously to v7.0.0, ESLint would only lint files with a `.js` extension by default. - -``` -$ eslint src -``` +Previously to v7.0.0, ESLint would only lint files with a `.js` extension by default if you give directories like `eslint src`. ESLint 7.0.0 will now additionally lint files with other extensions (`.ts`, `.vue`, etc.) if the extension is explicitly matched by an `overrides[].files` entry. This will allow for users to lint files that don't end with `*.js` to be linted without having to use the `--ext` command line flag, as well as allow shared configuration authors to enable linting of these files without additional overhead for the end user. Please note that patterns that end with `*` are exempt from this behavior and will behave as they did previously. For example, if the following config file is present, @@ -65,7 +61,7 @@ overrides: then running `eslint src` would check both `*.js` and `*.ts` files in the `src` directory. -**To address:** Using the `--ext` CLI option will override this new behavior. Run ESLint with `--ext .js` if you are using `overrides` but only want to lint files that have a `.js` extension. +**To address:** Using the `--ext` CLI option will override this new behavior. Run ESLint with `--ext .js` if you are using `overrides` but only want to lint files that have a `.js` extension. If you maintain plugins that check files with extensions other than `.js`, this feature will allow you to check these files by default by configuring an `overrides` setting in your `recommended` preset. From 1299a4a7bc9e8e9bc8cccb0e30ca51909c72d64c Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 5 May 2020 21:54:56 +0900 Subject: [PATCH 68/74] replace 7 and 7.0.0 by v7.0.0 --- docs/user-guide/migrating-to-7.0.0.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index e8e5dceb7f0..516698e6882 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -41,7 +41,7 @@ Node.js 8 reached EOL in December 2019, and we are officially dropping support f - Node.js 10 (`10.12.0` and above) - Node.js 12 and above -**To address:** Make sure you upgrade to at least Node.js `10.12.0` when using ESLint 7. One important thing to double check is the Node.js version supported by your editor when using ESLint via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 6 until you are able to upgrade Node.js. +**To address:** Make sure you upgrade to at least Node.js `10.12.0` when using ESLint v7.0.0. One important thing to double check is the Node.js version supported by your editor when using ESLint via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 6 until you are able to upgrade Node.js. **Related issue(s):** [RFC44](https://github.com/eslint/rfcs/blob/master/designs/2019-drop-node8/README.md), [#12700](https://github.com/eslint/eslint/pull/12700) @@ -49,7 +49,7 @@ Node.js 8 reached EOL in December 2019, and we are officially dropping support f Previously to v7.0.0, ESLint would only lint files with a `.js` extension by default if you give directories like `eslint src`. -ESLint 7.0.0 will now additionally lint files with other extensions (`.ts`, `.vue`, etc.) if the extension is explicitly matched by an `overrides[].files` entry. This will allow for users to lint files that don't end with `*.js` to be linted without having to use the `--ext` command line flag, as well as allow shared configuration authors to enable linting of these files without additional overhead for the end user. Please note that patterns that end with `*` are exempt from this behavior and will behave as they did previously. For example, if the following config file is present, +ESLint v7.0.0 will now additionally lint files with other extensions (`.ts`, `.vue`, etc.) if the extension is explicitly matched by an `overrides[].files` entry. This will allow for users to lint files that don't end with `*.js` to be linted without having to use the `--ext` command line flag, as well as allow shared configuration authors to enable linting of these files without additional overhead for the end user. Please note that patterns that end with `*` are exempt from this behavior and will behave as they did previously. For example, if the following config file is present, ```yml # .eslintrc.yml @@ -88,7 +88,7 @@ Starting in ESLint v7, configuration files and ignore files passed to ESLint usi In previous versions, ESLint resolved all plugins from the current working directory by default. -Starting in ESLint 7.0.0, `plugins` are resolved relative to the directory path of the _entry_ configuration file. +Starting in ESLint v7.0.0, `plugins` are resolved relative to the directory path of the _entry_ configuration file. This will not change anything in most cases. If a configuration file in a subdirectory has `plugins` defined, the plugins will be loaded from the subdirectory (or ancestor directories that include the current working directory if not found). @@ -100,7 +100,7 @@ This means that if you are using a config file from a shared location via `--con ## Runtime deprecation warnings for `~/.eslintrc.*` config files -Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). ESLint 7.0.0 will start printing runtime deprecation warnings. It will print a warning for the following situations: +Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). ESLint v7.0.0 will start printing runtime deprecation warnings. It will print a warning for the following situations: 1. When a project does not have a configuration file present and ESLint loads configuration from `~/.eslintrc.*`. 1. When a project has a configuration file and ESLint ignored a `~/.eslintrc.*` configuration file. This occurs when the `$HOME` directory is an ancestor directory of the project and the project's configuration files doesn't contain `root:true`. @@ -117,7 +117,7 @@ Up until now, ESLint has ignored the following files by default: - `node_modules` in the current working directory (`/node_modules/*`) - `bower_components` in the current working directory (`/bower_components/*`) -ESLint 7 ignores `node_modules/*` of subdirectories as well, but no longer ignores `bower_components/*` and `.eslintrc.js`. Therefore, the new default ignore patterns are: +ESLint v7.0.0 ignores `node_modules/*` of subdirectories as well, but no longer ignores `bower_components/*` and `.eslintrc.js`. Therefore, the new default ignore patterns are: - Dotfiles except `.eslintrc.*` (`.*` but not `.eslintrc.*`) - `node_modules` (`/**/node_modules/*`) @@ -130,7 +130,7 @@ ESLint 7 ignores `node_modules/*` of subdirectories as well, but no longer ignor In older version of ESLint, there was no convenient way to indicate why a directive comment – such as `/*eslint-disable*/` – was necessary. -To allow for the colocation of comments that provide context with the directive, ESLint 7.0.0 adds the ability to append arbitrary text in directive comments by ignoring text following `--`. For example: +To allow for the colocation of comments that provide context with the directive, ESLint v7.0.0 adds the ability to append arbitrary text in directive comments by ignoring text following `--`. For example: ```js // eslint-disable-next-line a-rule, another-rule -- those are buggy!! From ddf3b67d091fa57f93a35bfacf85a6d087c57bfa Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Wed, 6 May 2020 14:03:50 +0900 Subject: [PATCH 69/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kevin Partington --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 516698e6882..be5f8f15a2b 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -208,7 +208,7 @@ The `RuleTester` now validates the following: The [`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by the new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class). -The `CLIEngine` class provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shared configs, parsers, plugins, and formatters, and adding the abilitiy to visually display the progress of linting runs. The new `ESLint` class provides an asynchronous API that ESLint core will now using going forward. `CLIEngine` will remain in core for the foreseeable future but may be removed in a future major version. +The `CLIEngine` class provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shared configs, parsers, plugins, and formatters, and adding the ability to visually display the progress of linting runs. The new `ESLint` class provides an asynchronous API that ESLint core will now using going forward. `CLIEngine` will remain in core for the foreseeable future but may be removed in a future major version. **To address:** Update your code to use the new `ESLint` class if you are currently using `CLIEngine`. The following table maps the existing `CLIEngine` methods to their `ESLint` counterparts: From 86ebcda4c9b7499a6cf0774b722d4e6f007e8758 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Wed, 6 May 2020 14:05:50 +0900 Subject: [PATCH 70/74] Update docs/user-guide/migrating-to-7.0.0.md Co-authored-by: Kevin Partington --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index be5f8f15a2b..3664a2988f0 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -188,7 +188,7 @@ Three new rules have been enabled in the `eslint:recommended` preset. - [no-import-assign](https://eslint.org/docs/rules/no-import-assign) - [no-setter-return](https://eslint.org/docs/rules/no-setter-return) -**To address:** Fix errors or use disable these rules. +**To address:** Fix errors or disable these rules. **Related issue(s):** [#12920](https://github.com/eslint/eslint/pull/12920) From 1e3e33d704e1518ad8f84e65e5f2c66e21e89408 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Wed, 6 May 2020 14:11:15 +0900 Subject: [PATCH 71/74] fix feature list --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 3664a2988f0..b9cb727bc7c 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -208,7 +208,7 @@ The `RuleTester` now validates the following: The [`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by the new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class). -The `CLIEngine` class provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shared configs, parsers, plugins, and formatters, and adding the ability to visually display the progress of linting runs. The new `ESLint` class provides an asynchronous API that ESLint core will now using going forward. `CLIEngine` will remain in core for the foreseeable future but may be removed in a future major version. +The `CLIEngine` class provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shareable configs/parsers/plugins/formatters, and adding the ability to visually display the progress of linting runs. The new `ESLint` class provides an asynchronous API that ESLint core will now using going forward. `CLIEngine` will remain in core for the foreseeable future but may be removed in a future major version. **To address:** Update your code to use the new `ESLint` class if you are currently using `CLIEngine`. The following table maps the existing `CLIEngine` methods to their `ESLint` counterparts: From 79f805d99e8b797b9e8140e1859e18a577fa8ebb Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Wed, 6 May 2020 14:17:32 +0900 Subject: [PATCH 72/74] fix "may has" --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index b9cb727bc7c..8c4c6bfb6ec 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -226,7 +226,7 @@ The `CLIEngine` class provides a synchronous API that is blocking the implementa | `getRules()` | (not implemented yet) | | `resolveFileGlobPatterns()` | (removed ※2) | -- ※1 The `engine.getFormatter()` method currently returns the object of loaded packages as-is, which made it difficult to add new features to formatters for backward compatibility reasons. The new `eslint.loadFormatter()` method returns an adapter object that wraps the object of loaded packages, to ease the process of adding new features. Additionally, the adapter object may has access to the `ESLint` instance to calculate default data (using loaded plugin rules to make `rulesMeta`, for example). As a result, the `ESLint` class only implements an instance version of the `loadFormatter()` method. +- ※1 The `engine.getFormatter()` method currently returns the object of loaded packages as-is, which made it difficult to add new features to formatters for backward compatibility reasons. The new `eslint.loadFormatter()` method returns an adapter object that wraps the object of loaded packages, to ease the process of adding new features. Additionally, the adapter object has access to the `ESLint` instance to calculate default data (using loaded plugin rules to make `rulesMeta`, for example). As a result, the `ESLint` class only implements an instance version of the `loadFormatter()` method. - ※2 Since ESLint 6, ESLint uses different logic from the `resolveFileGlobPatterns()` method to iterate files, making this method obsolete. **Related issue(s):** [RFC40](https://github.com/eslint/rfcs/blob/master/designs/2019-move-to-async-api/README.md), [#12939](https://github.com/eslint/eslint/pull/12939) From d3257eed8c48fdb899e19c762fff604920e7a6c9 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Wed, 6 May 2020 14:19:22 +0900 Subject: [PATCH 73/74] fix "use directive comments to..." --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index 8c4c6bfb6ec..bb89ba94d2b 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -176,7 +176,7 @@ Several rules have been enhanced and now report additional errors: - [use-isnan](https://eslint.org/docs/rules/use-isnan) rule now recognizes class members by default. - [yoda](https://eslint.org/docs/rules/yoda) rule now recognizes bigint literals. -**To address:** Fix errors or use directive comments to disable the rules. +**To address:** Fix errors or disable these rules. **Related issue(s):** [#12490](https://github.com/eslint/eslint/pull/12490), [#12608](https://github.com/eslint/eslint/pull/12608), [#12670](https://github.com/eslint/eslint/pull/12670), [#12701](https://github.com/eslint/eslint/pull/12701), [#12765](https://github.com/eslint/eslint/pull/12765), [#12837](https://github.com/eslint/eslint/pull/12837), [#12913](https://github.com/eslint/eslint/pull/12913), [#12915](https://github.com/eslint/eslint/pull/12915), [#12919](https://github.com/eslint/eslint/pull/12919) From ba479ab450f081e5587d0f4d26fd3d6475cece03 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Wed, 6 May 2020 14:25:31 +0900 Subject: [PATCH 74/74] add "surrounded by whitespace" --- docs/user-guide/migrating-to-7.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/migrating-to-7.0.0.md b/docs/user-guide/migrating-to-7.0.0.md index bb89ba94d2b..9819b2152cc 100644 --- a/docs/user-guide/migrating-to-7.0.0.md +++ b/docs/user-guide/migrating-to-7.0.0.md @@ -130,7 +130,7 @@ ESLint v7.0.0 ignores `node_modules/*` of subdirectories as well, but no longer In older version of ESLint, there was no convenient way to indicate why a directive comment – such as `/*eslint-disable*/` – was necessary. -To allow for the colocation of comments that provide context with the directive, ESLint v7.0.0 adds the ability to append arbitrary text in directive comments by ignoring text following `--`. For example: +To allow for the colocation of comments that provide context with the directive, ESLint v7.0.0 adds the ability to append arbitrary text in directive comments by ignoring text following `--` surrounded by whitespace. For example: ```js // eslint-disable-next-line a-rule, another-rule -- those are buggy!!