Projects

Project News: What’s new in ESLint v7.0.0

ESLint is an open source JavaScript linting utility and an At-Large project at the OpenJS Foundation.

Project News: What’s new in ESLint v7.0.0

ESLint is an open source JavaScript linting utility and an At-Large project at the OpenJS Foundation. 

Congrats to the ESLint team on their most recent release, v7.0.0! This new release brings new updates including improved developer experience, core rule changes, new ESLint class, and much more. 

ESLint v7.0.0 Highlights:

Dropping support for Node.js v8

Node.js 8 reached EOL in December 2019, and we are officially dropping support for it in this release.

Core rule changes

  1. The ten Node.js/CommonJS rules in core have been deprecated and moved to the eslint-plugin-node plugin.
  2. Several rules have been updated to recognize bigint literals and warn on more cases by default.
  3. eslint:recommended has been updated with a few new rules: no-dupe-else-if, no-import-assign, and no-setter-return.

Improved developer experience

  1. The default ignore patterns have been updated. ESLint will no longer ignore .eslintrc.js and bower_components/* by default. Additionally, it will now ignore nested node_modules directories by default.
  2. ESLint will now lint files with extensions other than .js if they are explicitly defined in overrides[].files – no need to use the --ext flag!
  3. ESLint now supports descriptions in directive comments, so things like disable comments can now be clearly documented!
  4. Additional validation has been added to the RuleTester class to improve testing custom rules in plugins.
  5. ESLint will now resolve plugins relative to the entry configuration file. This means that shared configuration files that are located outside the project can now be colocated with the plugins they require.
  6. 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.

New ESLint class

  1. 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.

Check out the release notes for all updates here and the migration guide here.

For more information on ESLint and how to get involved go to https://eslint.org/.