7.0.0 Release
- ESLint 8 support!
- Zero-config Next.js linting!
- Zero-config TypeScript linting!
- New rules were added, which could potentially break builds.
- Requires node
12.20.0
or higher. - Requires eslint
8.7.0
or higher. (#175) - React filename extensions should be
.jsx
now instead of.js
to more explicitly call out which files contain React and which files are pure JavaScript.- renamer can be used to aid in this conversion. For example:
npx renamer --find js --replace jsx "components/**" --dry-run
(remove--dry-run
once everything looks good). - Probably update your NPM scripts to use
eslint . --ext .js,.jsx
.
- renamer can be used to aid in this conversion. For example:
package.json
property ordering for consistency across projects.
- Adds
Link
as an ESLint shared settinglinkComponents
.- Helps support routing framworks, like Next.js (see eslint-plugin-react's custom link components for more information).
- Adds
.json5
and.jsonc
as supported extensions. - Adds automatic disabling of
unicorn/no-null
if GraphQL is used. (#154) - Adds plugins.
- eslint-plugin-jest-formatting (#145)
- eslint-plugin-jsonc
- eslint-plugin-next (#142)
- Zero-config Next.js linting!
- @typescript-eslint/eslint-plugin (#176)
- Zero-config TypeScript linting!
- Adds rules.
- eslint/dot-location
- eslint/dot-notation
- eslint/no-multi-assign
- eslint/no-unused-private-class-members
- eslint/no-void
- eslint/prefer-object-has-own
- import/no-import-module-exports
- import/no-relative-packages
- jest/prefer-comparison-matcher
- jest/prefer-equality-matcher
- jest/prefer-to-be
- jest/prefer-expect-resolves
- jest/valid-describe-callback
- react/no-arrow-function-lifecycle
- react/no-invalid-html-attribute
- react/no-namespace
- react/no-unstable-nested-components
- unicorn/no-array-method-this-argument
- unicorn/no-array-reduce (#156)
- unicorn/no-await-expression-member
- unicorn/no-document-cookie
- unicorn/no-empty-file (#129)
- unicorn/no-invalid-remove-event-listener
- unicorn/no-static-only-class
- unicorn/no-thenable
- unicorn/no-useless-fallback-in-spread
- unicorn/no-useless-length-check
- unicorn/no-useless-promise-resolve-reject
- unicorn/no-useless-spread
- unicorn/numeric-separators-style
- unicorn/prefer-array-flat
- unicorn/prefer-at
- unicorn/prefer-code-point
- unicorn/prefer-export-from
- unicorn/prefer-json-parse-buffer
- unicorn/prefer-object-from-entries
- unicorn/prefer-prototype-methods
- unicorn/relative-url-style
- unicorn/require-array-join-separator
- unicorn/require-number-to-fixed-digits-argument
- unicorn/require-post-message-target-origin
- unicorn/template-indent
- unicorn/prefer-node-protocol
- Only enabled for node versions
14.18.0
or higher and when not using Next.js (open issue).
- Only enabled for node versions
- Changes
ecmaVersion
tolatest
- Saves us from having to manually bump it every year (see ESLint's Parser Options for more information).
- Changes which React rules are enabled if version
17.0.0
or higher.- The react/jsx-uses-react and react/react-in-jsx-scope rules will be disabled if React's version is
17.0.0
and above as they are no longer necessary (see Introducing the New JSX Transform for more information).
- The react/jsx-uses-react and react/react-in-jsx-scope rules will be disabled if React's version is
- Changes rule options.
- eslint/comma-dangle
- Adds
always-multiline
option. Makes git diffs easier to understand.
- Adds
- eslint/no-implicit-coercion
- Adds
disallowTemplateShorthand
option.
- Adds
- eslint-comments/no-unlimited-disable
- Duplicate of
unicorn/no-abusive-eslint-disable
.
- Duplicate of
- import/no-unresolved
- Adds
caseSensitive
andcaseSensitiveStrict
options.
- Adds
- import/order
- Adds
warnOnUnassignedImports
option.
- Adds
- jest/no-restricted-matchers
- Removes
resolves
matcher as it was causing conflicts with jest/valid-expect and jest/prefer-expect-resolves rules.
- Removes
- node/prefer-global/buffer
- Changes
always
tonever
based on Node.js documentation.
- Changes
- node/prefer-global/process
- Changes
always
tonever
based on Node.js documentation.
- Changes
- react/jsx-filename-extension
- Changes
extensions
from.js
to.jsx
to more explicitly call out which files contain React and which files are pure JavaScript.- renamer can be used to aid in this conversion. For example:
npx renamer --find js --replace jsx "components/**" --dry-run
(remove--dry-run
once everything looks good). - Probably update your NPM scripts to use
eslint . --ext .js,.jsx
- renamer can be used to aid in this conversion. For example:
- Changes
- react/jsx-no-target-blank
- Adds
forms
option.
- Adds
- eslint/comma-dangle
- Fixes false positives with
import/extensions
and mixed CommonJS / ESM usage. - Fixes false positives with React JSX transform rules for older versions of React.
- Removes plugins.
- eslint-plugin-json
- Replaced by eslint-plugin-jsonc, as
eslint-plugin-json
uses a non-standard preprocessor (it's using vscode-json-languageservice) and currently returns an empty string, which makes it difficult for other plugins to work alongside of it (see azeemba/eslint-plugin-json#38 for more information).eslint-plugin-jsonc
uses the standard ESLint parser espree to create compliant, and thus harmonious, AST.
- Replaced by eslint-plugin-jsonc, as
- eslint-plugin-json
- Removes rules.
- eslint/lines-between-class-members
- Messed with the
exceptAfterSingleLine
option, but ultimately couldn't find a combination we liked, so we're removing it.
- Messed with the
jest/prefer-to-be-null
- Replaced by jest/prefer-to-be.
jest/prefer-to-be-undefined
- Replaced by jest/prefer-to-be.
jest/valid-describe
- Replaced by jest/valid-describe-callback.
- eslint/lines-between-class-members