- The minimum required TypeScript version changed to 5 (#67461)
- Add
@wordpress/i18n-no-flanking-whitespace
to the recommended i18n ruleset (#64710. - Add
@wordpress/i18n-hyphenated-range
to the recommended i18n ruleset (#64710.
- Add
@typescript-eslint/no-unused-vars
rule to the recommended TypeScript ruleset (#62925). - Add
@typescript-eslint/method-signature-style
rule to the recommended TypeScript ruleset (#62718).
@wordpress/is-gutenberg-plugin
rule has been replaced by@wordpress/wp-global-usage
(#61486).@wordpress/wp-process-env
rule has been added and included in the recommended configurations (#61486).@wordpress/gutenberg-phase
rule has been removed (deprecated in v10.0.0) (#61486).- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases (#31270). Learn more about Node.js releases.
- Replaced
classnames
package with the faster and smallerclsx
package (#61138).
- Enable
curly
eslint rule when using prettier (#61204).
- Change the required major version of Prettier from v2 to v3 (#54775).
- The bundled
@typescript-eslint/parser
and@typescript-eslint/eslint-plugin
dependencies has been updated from requiring ^5.62.0 to requiring ^6.4.1 (#53975):- Removes the deprecated
@typescript-eslint/no-duplicate-imports
rule in favor ofimport/no-duplicates
.
- Removes the deprecated
- Added a new
test-playwright
ruleset usingeslint-plugin-playwright
. - The bundled
eslint-plugin-prettier
dependency has been updated from requiring^3.3.0
to requiring^5.0.0
(#54539).
- The bundled
eslint-plugin-jsdoc
dependency has been updated from requiring ^39.6.9 to requiring ^46.4.6 (#53629):- Removes
jsdoc/newline-after-description
rule in favor ofjsdoc/tag-lines
with optionstartLines: 0
for "never" andstartLines: 1
for "always". Defaults now tostartLines: null
. - Removes
dropEndLines: true
fromjsdoc/tag-lines
in favor of optionendLines: 0
. - Drops
jsdoc/tag-lines
rule'snoEndLines: true
in favor ofapplyToEndTag: false
. - Disables the newly introduced
jsdoc/no-defaults
rule.
- Removes
- Support Typescript 5 and 5.1 by updating both
@typescript-eslint/parser
and@typescript-eslint/eslint-plugin
to version^5.62.0
. (#52621).
- Validate dependencies in
useSelect
anduseSuspenseSelect
hooks. (#49900).
- Increase the severity of the rule
jsdoc/check-line-alignment
fromwarn
toerror
. (#47878).
- The bundled
eslint-plugin-jsdoc
dependency has been updated from requiring^37.0.3
to requiring^39.6.9
- Bump
eslint-plugin-jest
version to 27.2.1.
- Increase the minimum Node.js version to 14 and minimum npm version to 6.14.4 (#43141).
- Remove all rules targeting test files from the
recommended
andrecommended-with-formatting
presets when Jest package is installed (#43272).
- Remove deprecated rules
no-negated-in-lhs
replaced withno-unsafe-negation
, andjsx-a11y/label-has-for
replaced withjsx-a11/label-has-associated-control
(#42654).
- Enable
no-unused-vars
's settingignoreRestSiblings
to allow unused variables when destructuring with rest properties (#41897).
- Fix the
recommended
preset when Prettier is not installed (#40634).
- Revert the removal of the automatic environment detection of
test-unit
andtest-e2e
for therecommended
preset. However, They will still be disabled if@playwright/test
is installed in the project.
- The integration with Prettier is now optional and gets activated when the
prettier
package is installed in the project (#39244).
- Replaced no-shadow eslint rule with @typescript-eslint/no-shadow (#38665).
- Remove automatic environment detection of
test-unit
andtest-e2e
for therecommended
preset. It's now recommended to opt-in to specific preset explicitly.
- The peer dependency constraint for ESLint has been updated from
^6 || ^7
to^8
. - The bundled
@typescript-eslint/eslint-plugin
dependency has been updated from requiring^4.31.0
to requiring^5.3.0
(#36283). - The bundled
@typescript-eslint/parser
dependency has been updated from requiring^4.31.0
to requiring^5.3.0
(#36283). - The bundled
eslint-config-prettier
dependency has been updated from requiring^7.1.0
to requiring^8.3.0
(#36283). - The bundled
eslint-plugin-jest
dependency has been updated from requiring^24.1.3
to requiring^25.2.3
(#36283). - The bundled
eslint-plugin-jsdoc
dependency has been updated from requiring^36.0.8
to requiring^37.0.3
(#36283). - The bundled
globals
dependency has been updated from requiring^12.0.0
to requiring^13.12.0
(#36283). - The
gutenberg-phase
rule has been deprecated and replaced by theis-gutenberg-plugin
rule. (#38202)
- Omit verification for WordPress dependencies in the import statements since they get externalized when used with WordPress (#37639).
- Fix Babel config resolution when a custom ESLint config present (#37406). Warning: it won't recognize the
babel.config.json
file present in the project until the upstream bug incosmiconfig
is fixed.
- Replaced deprecated
babel-eslint
dependency with@babel/eslint-parser
(#36244). - The bundled
eslint-plugin-import
dependency has been updated from requiring^2.23.4
to requiring^2.25.2
(#36244).
- The bundled
eslint-plugin-jsdoc
dependency has been updated from requiring^34.1.0
to requiring^36.0.8
(#34338).
- Use Jest related rules only when the
jest
package is installed (#33120).
- The recommended configuration will now respect
type
imports in TypeScript files (#34055).
- Include
.jsx
extension when linting import statements in case TypeScript not present (#33746).
- Adds JSDoc alignment check (#25300).
- Adds TypeScript as a peer dependency and makes it optional when not installed (#29942).
- Add support and configuration for TypeScript files. #27143
- Enabled
import/default
andimport/named
rules in therecommended
ruleset. #28513 - Add new rule
@wordpress/data-no-store-string-literals
to discourage passing string literals to reference data stores (#28726).
- Add missing
eslint-plugin-import
npm dependency (#28545).
- Increase the minimum Node.js version to 12 (#27934).
- Enabled
import/no-extraneous-dependencies
rule in therecommended
ruleset. - Enabled
import/no-unresolved
rule in therecommended
ruleset. - Enabled
no-unsafe-wp-apis
rule in therecommended
ruleset (#27327). - The bundled
eslint-config-prettier
dependency has been updated from requiring^6.10.1
to requiring^7.1.0
(#27965). - The bundled
eslint-plugin-jest
dependency has been updated from requiring^23.8.2
to requiring^24.1.3
(#27965).
- The bundled
eslint-plugin-jsdoc
dependency has been updated from requiring^30.2.2
to requiring^30.7.13
(#27965). - The bundled
eslint-plugin-jsx-a11y
dependency has been updated from requiring^6.2.3
to requiring^6.4.1
(#27965). - The bundled
eslint-plugin-prettier
dependency has been updated from requiring^3.1.2
to requiring^3.3.0
(#27965). - The bundled
eslint-plugin-react
dependency has been updated from requiring^7.20.0
to requiring^7.22.0
(#27965). - The bundled
eslint-plugin-react-hooks
dependency has been updated from requiring^4.0.4
to requiring^4.2.0
(#27965).
- Enable
react-hooks/exhaustive-deps
rules in the react config in "warn" mode (#24914).
- Add
no-unsafe-wp-apis
rule to discourage usage of unsafe APIs (#27301).
- The bundled
wp-prettier
dependency has been upgraded from2.0.5
to2.2.1
.
- Include a note about the minimum version required for
node
(10.0.0) andnpm
(6.9.0).
- Fix TypeError for projects without a local Prettier configuration.
- The bundled
eslint-plugin-jsdoc
dependency has been updated from requiring^26.0.0
to requiring^30.2.2
.
- The recommended configuration will now respect local Prettier configuration. These are merged to the default WordPress configuration.
- Support ESLint
^7
as peer dependency.
- The bundled
wp-prettier
dependency has been upgraded from1.19.1
to2.0.5
. Refer to the Prettier 2.0 "2020" blog post for full details about the major changes included in Prettier 2.0. - The bundled
eslint-plugin-react-hooks
dependency has been updated from requiring^3.0.0
to requiring^4.0.4
. - The bundled
eslint-plugin-jsdoc
dependency has been updated from requiring^22.1.0
to requiring^26.0.0
.
- The bundled
eslint-plugin-react
dependency has been updated from requiring^7.19.0
to requiring^7.20.0
.
@wordpress/dependency-group
will now correctly identify issues associated with CommonJS (require
) module imports.
- The severity of the rule,
jsdoc/no-undefined-types
, has been increased fromwarn
toerror
. In addition,JSX
has been added to the default list of defined types.
'AsyncIterableIterator'
is now allowed as a valid TypeScript utility type.
- The
@wordpress/no-unused-vars-before-return
rule will now correctly identify valid usage of a variable as a JSX identifier. - Make
@wordpress/i18n-text-domain
rule less strict by default. WhenallowedTextDomain
option is not provided it allows now skipping text domain or providing any string (#21928).
- Fixes an error caused by missing
utils
directory from published package (#21609). - Added the recommended
Prettier
config that enforces WordPress coding style guidelines (#21602).
- There is a new
i18n
ruleset that includes all i18n-related rules and is included in therecommended
ruleset. - The
@wordpress/valid-sprintf
rule has been moved from thecustom
ruleset to thei18n
ruleset. - The
@wordpress/valid-sprintf
rule now recognizes mix of ordered and non-ordered placeholders. - The bundled
eslint-plugin-jest
dependency has been updated from requiring^22.15.1
to requiring^23.8.2
(#21424). - The bundled
eslint-plugin-jsdoc
dependency has been updated from requiring^21.0.0
to requiring^22.1.0
(#21424). - The bundled
eslint-plugin-react-hooks
dependency has been updated from requiring^1.6.1
to requiring^3.0.0
(#21424).
- New Rule:
@wordpress/i18n-text-domain
- New Rule:
@wordpress/i18n-translator-comments
- New Rule:
@wordpress/i18n-no-variables
- New Rule:
@wordpress/i18n-no-placeholders-only
- New Rule:
@wordpress/i18n-no-collapsible-whitespace
- New Rule:
@wordpress/i18n-ellipsis
- The bundled
eslint-plugin-react
dependency has been updated from requiring^7.14.3
to requiring^7.19.0
(#21424).
- The
@wordpress/valid-sprintf
rule now detects usage ofsprintf
viai18n.sprintf
(e.g. when usingimport * as i18n from '@wordpress/i18n'
). @wordpress/no-unused-vars-before-return
will correctly consider other unused variables after encountering an instance of anexcludePattern
option exception.
- The
prefer-const
rule included in therecommended
andesnext
rulesets has been relaxed to allow alet
assignment if any of a destructuring assignment are reassigned.
- The
recommended
ruleset checks again code formatting (whitespace, indenting, etc.). These rules are now enforced by Prettier itself through a plugin that diffs the code with its formatted output and reports the differences as lint errors.eslint-plugin-prettier
was chosen over options likeprettier-eslint
because we don't runeslint --fix
in hooks as we'd rather leave certain linting errors to be resolved or ignored at the author's discretion. We also don't apply any additional formatting witheslint
overprettier
, so the overhead would be unnecessary.eslint-plugin-prettier
was chosen over options likeprettier --check
because it's nice to see format errors as you type as it leads you to write code with a more optimal auto-formatted output and it avoids issues like comment directives being moved out of place byprettier
and the author not realizing it.
- Removed
plugin:prettier/recommended
fromrecommended
ruleset as it introduces breaking changes.
- The
recommended
ruleset no longer enables rules that check code formatting (whitespace, indenting, etc.) and that could conflict with Prettier. - There is a new
recommended-with-formatting
ruleset that has the code formatting rules still enabled, for projects that want to opt out from Prettier and continue checking code formatting with ESLint.
- The React ruleset now correctly references the WordPress ESLint plugin, resolving an error about an unfound rule.
- The
@wordpress/no-unused-vars-before-return
rule has been improved to exempt object destructuring only if destructuring to more than one property. - Stricter JSDoc linting using
eslint-plugin-jsdoc
. - Stricter validation enabled for test files only using new
test-e2e
andtest-unit
rulesets.
- New Rule:
@wordpress/no-unguarded-get-range-at
- Enable
wp
global by default in therecommended
config. - New ruleset
test-e2e
added for end-to-end tests validation. - New ruleset
test-unit
added for unit tests validation.
- Remove
@wordpress/dependency-group
and@wordpress/gutenberg-phase
rules from thecustom
andrecommended
configs and leave them as opt-in features.
@wordpress/no-unused-vars-before-return
now supports anexcludePattern
option to exempt function calls by name.
- The recommended
react
configuration specifies an option to@wordpress/no-unused-vars-before-return
to exempt React hooks usage, by convention of hooks beginning with "use" prefix. - The plugin now uses
eslint-plugin-jsdoc
, rather than thevalid-jsdoc
rule, for more reliable linting of JSDoc blocks.
- Fixed custom regular expression for the
no-restricted-syntax
rule enforcing translate function arguments. #15839. - Fixed arguments checking of
_nx
for theno-restricted-syntax
rule enforcing translate function arguments. #15839. - Fixed false positive with
react-no-unsafe-timeout
which would wrongly flag errors when assigningsetTimeout
result to a variable (for example, in auseEffect
hook).
- New Rule:
@wordpress/react-no-unsafe-timeout
- Add React Hooks Rules config.
- The bundled
eslint-plugin-jsx-a11y
dependency has been updated from requiring^6.0.2
to requiring^6.2.1
(see new features added in 6.2.0 and 6.1.0). - The bundled
eslint-plugin-react
dependency has been updated from requiring7.7.0
to requiring^7.12.4
(see new features added in 7.12.0, 7.11.0, 7.10.0, 7.9.0 and 7.8.0).
- The
esnext
andrecommended
rulesets now enforceobject-shorthand
- The
es5
andrecommended
rulesets now enforcearray-callback-return
- New Rule:
@wordpress/no-unused-vars-before-return
- New Rule:
@wordpress/dependency-group
- New Rule:
@wordpress/valid-sprintf
- New Rule:
@wordpress/gutenberg-phase
- New Rule:
@wordpress/no-base-control-with-label-without-id
- Initial release.