- fix: fixed named export 'JsxEmit' not found, closes #1095 by @Rel1cx in #1096
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.48.4...v1.48.5
- fix: update fallback react version in settings to "19.1.0"
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.48.3...v1.48.4
- refactor: improve settings handling by @Rel1cx in #1080
- docs: add more examples to
web-api/no-leaked-event-listener
docs by @Rel1cx in #1082
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.48.2...v1.48.3
- fix: could not find
hooks-extra/no-direct-set-state-in-use-effect
in pluginreact-hooks-extra
, closes #1077 by @Rel1cx in #1078
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.48.1...v1.48.2
- fix: rewrite react api detection to better align with
eslint-plugin-react-hook
by @Rel1cx in #1074 - fix: use preferred loc in error maker in
hooks-extra/no-unnecessary-use-prefix
by @Rel1cx in #1073
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.47.4...v1.48.0
- fix: update
hooks-extra/no-unnecessary-use-prefix
to skip well-known hooks likeuseMDXComponents
by @Rel1cx in #1072
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.47.3...v1.47.4
- fix: fixed potential false negatives in
no-leaked-conditional-rendering
when logical expressions are wrapped by type expressions by @Rel1cx in #1068
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.47.2...v1.47.3
- fix: use smaller error marker range to reduce visual noise by @Rel1cx in #1064
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.47.1...v1.47.2
- fix: better debug rules message formatting by @Rel1cx in #1062
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.47.0...v1.47.1
- refactor: remove
@eslint-react/jsx
package and move functionality to@eslint-react/core
by @Rel1cx in #1060
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.46.0...v1.47.0
- feat: use json for diagnostic output format of debug rules by @Rel1cx in #1058
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.45.3...v1.45.4
- perf: replace
Map
withWeakMap
by @Rel1cx in #1057
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.45.3...v1.45.4
- pref: replace
picomatch.makeRe
withRE.toRegExp
for pattern matching by @Rel1cx in #1055
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.45.2...v1.45.3
- docs: add table of contents to the README by @Rel1cx in https://github.com/Rel1cx/eslint-react/commit/b880cb95d2245f7034f47e883d944c9a8b4ecf5f
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.45.1...v1.45.2
- fix: fixed
hooks-extra/no-unnecessary-use-prefix
case sensitivity fails, closes #1053 by @Rel1cx in #1054
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.45.0...v1.45.1
- feat: add
react-x/no-misused-capture-owner-stack
rule, closes #1049 by @Rel1cx in #1047 - feat: add
react-x/no-nested-lazy-component-declarations
rule, closes #1048 by @Rel1cx in #1052 - feat: add
react-x/no-nested-lazy-component-declarations
rule to recommended presets by @Rel1cx
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.44.0...v1.45.0
- feat: add JSX fragment factory to error message of
react-x/avoid-shorthand-fragment
by @Rel1cx in #1051
- perf: replace
valibot
with@zod/mini
by @Rel1cx in #1050
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.43.0...v1.44.0
- feat: add codemod feature to
react-x/no-string-refs
, closes #1044 by @Rel1cx in #1045
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.42.1...v1.43.0
- feat: rename
core
preset tox
by @Rel1cx in #1042
The following presets have been renamed:
core
tox
core-legacy
tox-legacy
The old preset names will still be available until the next major update to avoid breaking changes.
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.41.0...v1.42.1
- feat: add
react-debug/jsx
rule by @Rel1cx in #1041
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.40.4...1.41.0
- fix: refactor JSX runtime annotation handling by @Rel1cx in #1038
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.40.3...v1.40.4
- fix: fixed
no-useless-fragment
false positive when using
, closes #1035 by @Rel1cx in #1036
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.40.2...v1.40.3
- fix(react-x): fixed
jsx-uses-react
rule forpreserve
mode by @Rel1cx in #1031 - fix: use initial release year and consistent username in LICENSE by @Rel1cx in #1032
- refactor(kit): simplify
LanguagePreferenceSchema
by @Rel1cx in #1033 - refactor(website): reorganize CSS and improve theme by @Rel1cx in #1034
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.40.1...v1.40.2
- feat(react-x): enhance
jsx-uses-react
rule to support@jsx
and@jsxFrag
annotation comments by @Rel1cx in #1029 - feat(kit): add
LanguagePreference
by @Rel1cx in #1028
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.40.0...v1.40.1
- feat(react-x): add
react-x/jsx-uses-react
rule by @Rel1cx in #1027 - feat: enable
react-x/jsx-uses-react
rule in recommended presets by @Rel1cx in #1027 - feat: enable
naming-convention/context-name
rule in recommended presets by @Rel1cx in #1024 - feat(kit): add
JsxRuntime
module by @Rel1cx in #1025
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.38.4...v1.40.0
- chore: update default React version to 19.1.0 in documentation and settings by @Rel1cx in #1023
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.38.3...v1.38.4
- docs: switch back to the original slogan by @Rel1cx in https://github.com/Rel1cx/eslint-react/commit/e0e4d460c
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.38.2...v1.38.3
- fix(eslint-plugin): disable
prefer-shorthand-*
rules inall
config by @Rel1cx in https://github.com/Rel1cx/eslint-react/commit/a9e6ef9f97f968bb9366af3e5b40138fb4b6b679
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.38.0...v1.38.2
- feat: add
react-x/jsx-no-undef
rule, closes #1016 by @Rel1cx in #1018 - feat: add
hooks-extra/prefer-use-state-lazy-initialization
rule to recommended presets by @Rel1cx in #1019 - docs: add experimental status to rules overview by @Rel1cx in #1012
- refactor: undeprecate
react-x/jsx-uses-vars
andreact-x/jsx-no-duplicate-props
rules by @Rel1cx in #1017
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.37.3...v1.38.0
- fix: the requested module
ts-api-utils
does not provide an export namedunionConstituents
, closes #1009 by @Rel1cx in #1010
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.37.2...v1.37.3
- fix:
prefer-read-only-props
false positive using React types, closes #962 by @Rel1cx in #1008
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.37.1...v1.37.2
- fix: enhance
hooks-extra/prefer-use-state-lazy-initialization
to correctly detect other hooks called withinuseState(...)
by @Rel1cx in #1006
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.37.0...v1.37.1
- refactor: remove
hooks-extra/prefer-use-state-lazy-initialization
from recommended presets by @Rel1cx in #1001Based on feedback of this rule, the current implementation produces more false positives than expected, so to ensure the overall quality of the rules in the recommended presets we provide, I'm removing it from the presets for now, and should add it back after we implement a better heuristic for deciding which function calls should be allowed.
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.36.3...v1.37.0
- fix:
hooks-extra/prefer-use-state-lazy-initialization
false positive onuseState(use(promise))
closes #999 by @Rel1cx in #1000
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.36.2...v1.36.3
No notable changes have been made in this release.
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.36.1...v1.36.2
- refactor(naming-convention/use-state): enhance error messaging and docs, closes #980 by @Rel1cx in #997
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.35.0...v1.36.1
- feat(plugins/dom): add
no-render
rule to replaceReactDom.render()
withcreateRoot(node).render()
, closes #972 by @Rel1cx in #993 - feat(plugins/dom): add
no-hydrate
rule to replaceReactDom.hydrate()
withhydrateRoot()
, closes #973 by @Rel1cx in #995
- refactor: rename
hooks-extra/no-useless-custom-hooks
tohooks-extra/no-unnecessary-use-prefix
by @Rel1cx in #996
The following rules have been renamed:
react-hooks-extra/no-useless-custom-hooks
toreact-hooks-extra/no-unnecessary-use-prefix
@eslint-react/hooks-extra/no-useless-custom-hooks
to@eslint-react/hooks-extra/no-unnecessary-use-prefix
The old rule names will still be available until the next major update to avoid breaking changes.
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.34.1...v1.35.0
- fix: false positive in
react-x/no-context-provider
on symbols namedProvider
which are imported from third-party libs, closes #991 by @Rel1cx in #992
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.34.0...v1.34.1
- refactor: export the create function of each rule by @Rel1cx in #989
- refactor(plugins/x): rename
no-nested-components
rule tono-nested-component-definitions
and update related docs by @Rel1cx in #990
The following rules have been renamed:
react-x/no-nested-components
toreact-x/no-nested-component-definitions
@eslint-react/no-nested-components
to@eslint-react/no-nested-component-definitions
The old rule names will still be available until the next major update to avoid breaking changes.
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.33.0...v1.34.0
- fix: update rule severity for
no-flush-sync
andno-void-elements-with-children
in recommended presets by @Rel1cx in #988
- refactor(plugins/x): rename
ensure-forward-ref-using-ref
tono-useless-forward-ref
by @Rel1cx in #987
The following rules have been renamed:
react-x/ensure-forward-ref-using-ref
toreact-x/no-useless-forward-ref
@eslint-react/ensure-forward-ref-using-ref
to@eslint-react/no-useless-forward-ref
The old rule names will still be available until the next major update to avoid breaking changes.
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.32.1...v1.33.0
- fix: fixed
no-context-provider
replaces<Provider>
with<>
, closes #984 by @Rel1cx in #985
- feat: revert 'feat: add naming-convention/use-state and naming-convention/context-name to recommended presets by @Rel1cx in #956' by @Rel1cx in #982
- docs: update eslint configs in examples to use extends by @Rel1cx in #978
- docs: update ts configs in examples to use project references by @Rel1cx in #979
- feat: enhance regex handling in naming convention rules by @Rel1cx in #969
- docs: improve rules descriptions by @Rel1cx
- fix(plugins/hooks-extra): misidentification of
set
function in IIFE inside of hooks as its inside ofuseEffect
,useLayoutEffect
, closes #967 by @Rel1cx in #968
- refactor(plugins/hooks-extra): improve code reusability by @Rel1cx in #963
- @mrginglymus made their first contribution in #964
- feat: add
naming-convention/use-state
andnaming-convention/context-name
to recommended presets by @Rel1cx in #956
- fix: correct readonly checks and test cases in
prefer-read-only-props
by @Rel1cx in #957 - fix: rework
naming-convention/component-name
rule to follow [email protected] by @Rel1cx in #959Component names now need to start with an uppercase letter instead of a non-lowercase letter. This means
_Button
or_component
are no longer valid. - fix:
naming-convention/use-state
fails with multiple words, closes #960 by @Rel1cx in #961
- feat(plugins/naming-convention): add
context-name
rule by @Rel1cx in #952
- fix: fixed
naming-convention/use-state
works in components only, closes #953 by @Rel1cx in #954
- docs: use
recommended-typescript
for typescript files by @bluwy in #949
- @bluwy made their first contribution in #949
- feat(plugins/dom): add
no-flush-sync
rule by @Rel1cx in #942 - feat: add
skipImportCheck
setting by @Rel1cx
- refactor: code optimization by @Rel1cx in #945
- refactor: consistent ordering of arguments to context-aware utility functions by @Rel1cx in #946
- feat: add presets exports to modular plugins by @Rel1cx in #940
- feat: add
no-missing-context-display-name
rule by @Rel1cx in #941
- refactor: improve error messages by @Rel1cx in #936 and #937
- refactor: add
useEffect
toadditionalHooks
by @Rel1cx in #938 - refactor: change severity of
no-duplicate-key
rule fromerror
towarn
by @Rel1cx in #939
- fix(plugins/x): enhance
no-context-provider
rule to include context name in error messages by @Rel1cx in #935
No notable changes have been made in this release.
- feat(plugins/x): add 'no-use-context', closes #930 by @Rel1cx in #931
- feat(no-useless-fragment): auto fix support, closes #899 by @hyoban in #926
- docs: add setup guide for
ts-blank-eslint-parser
by @Rel1cx - docs: add setup example for
ts-blank-eslint-parser
by @Rel1cx
- fix(no-forward-ref): loose fix by @hyoban in #925
- refactor(website): switch from nextra to fumadocs by @Rel1cx in #928
- fix: fixed invalid rules for
disable-debug
,disable-dom
, anddisable-web-apis
configs, closes #923 by @Rel1cx in #924
- perf: overhaul performance optimizations
- feat(plugins/x): add auto-fix to
prefer-shorthand-fragment
, closes #898 (#902)
- fix(plugins/x): fixed false positives in
no-unstable-context-value
andno-unstable-default-props
by @Rel1cx in #896
- refactor: JSX fragments related rules no longer rely on
jsxPragma
andjsxPragmaFrag
settings to perform their checks by @Rel1cx in #893 - refactor: improve applicability of the
no-useless-fragment
andprefer-shorthand-fragment
rules - refactor: deprecate
settings["react-x"].jsxPragma
andsettings["react-x"].jsxPragmaFrag
as they are no longer needed by any rules - refactor: replace
short-unique-id
w/uid
by @SukkaW in #894
- fix(plugins/hooks-extra): fix
call
andnew
expression related false positives inno-unnecessary-use-memo
andno-unnecessary-use-callback
by @Rel1cx in #895
- perf: re-implement
no-duplicate-key
rule to improve its performance @Rel1cx in #891 and 33ab3cc - refactor: prevent potential interference from TypeScript's
as
,satisfies
, and non-null assertion operator in various rules
- docs: add getting started guides for JavaScript, TypeScript, and JavaScript with Babel
- docs: improve code samples in rules docs
- docs: improve
eslint.config.js
examples in README.md, docs and the examples folder - docs: improve the error message and description of various rules
- refactor(website): better website layout and navigation experience
The eslint.config.js
in the examples now uses tsconfig
's includes
and excludes
as the SSoT glob patterns for ESLint's files
and ignores
fields.
This approach can fundamentally avoid the errors[1, 2, 3] caused by mismatched config scopes between tsconfig.json
and eslint.config.js
when using type-checked rules.
- refactor(plugins/x): rename
jsx-use-vars
touse-jsx-vars
- refactor(plugins/x): rename
jsx-no-duplicate-props
tono-duplicate-jsx-props
- refactor(plugins/dom): rename
no-children-in-void-dom-elements
tono-void-elements-with-children
The following rules have been renamed:
jsx-uses-vars
touse-jsx-vars
jsx-no-duplicate-props
tono-duplicate-jsx-props
dom/no-children-in-void-dom-elements
todom/no-void-elements-with-children
The new rule names are aligned with the same rules in the biomejs/rules-sources/#eslint-plugin-react (if any) to enhance consistency. The old rule names will still be available until the next major update to avoid breaking changes.
- feat(plugins/hooks-extra): add
no-useless-custom-hooks
rule by @Rel1cx
- refactor(plugins/hooks-extra): deprecate rule
no-redundant-custom-hook
in favor ofno-useless-custom-hooks
(the previous rule will still be available until the next major update to avoid breaking changes)
no-useless-custom-hooks
now detects Hook calls within comments and the following code no longer triggers a warning:
// ✅ Good: A Hook that will likely use some other Hooks later
function useAuth() {
// TODO: Replace with this line when authentication is implemented:
// return useContext(Auth);
return TEST_USER;
}
- refactor(shared): replace
local-pkg
package with node built-in API by @Rel1cx in #881
- feat(plugins/x): add codemod-autofix to
no-component-will-*
by @Rel1cx in #879
- refactor: use default settings when no settings are provided in
settings["react-x"]
by @Rel1cx in https://github.com/Rel1cx/eslint-react/commit/40ca3bd1cd7adc44f40841b5b4635e0200b73a54 - docs: update
no-context-provider.mdx
by @danielrentz in #877 - docs: add 'Min. React' column to rules overview page by @Rel1cx in #880
- docs: add features section to rules overview page by @Rel1cx
- @danielrentz made their first contribution in #877
- feat(plugins/x): add
no-context-provider
rule by @Rel1cx - feat(plugins/x): add autofix for
no-forward-ref
rule by @Rel1cx in #874 - feat(plugins/eslint-plugin): add
no-forward-ref
andno-context-provider
to recommended presets by @Rel1cx
- refactor(plugins/eslint-plugin): remove
prefer-read-only-props
fromrecommended-type-checked
preset by @Rel1cx in #872 - refactor(plugins/eslint-plugin): hide
avoid-shorthand-boolean
andavoid-shorthand-fragment
from presets and docs by @Rel1cx in #876 - Update
@typescript-eslint
's packages to^8.18.0
- feat(plugins/x): add
no-forward-ref
rule by @Rel1cx in #870
- perf(plugins/dom): improve performance of
no-void-elements-with-children
by @Rel1cx
- fix(plugins/web-api): add 'forEach' support to 'no-leaked-event-listener', closes #842 by @Rel1cx in #867
- fix(plugins/web-api): add 'for of' support to 'no-leaked-event-listener', closes #842 by @Rel1cx in #869
- fix(plugins/x): 'no-array-index-key' mistaking 'foo.bar.map' for 'Rea… by @Rel1cx in #868
- Update
@typescript-eslint
's packages to^8.17.0
- Update
eslint
's packages to^9.16.0
- Update
@typescript-eslint
's packages to^8.16.0
- Update
ts-api-utils
to^2.0.0
- feat(shared): add version detection logic;
- fix(plugins/x): 'no-leaked-conditional-rendering' should also warn 'anyStringVar' when react version is lower than 18, closes #853 by @Rel1cx in #864
- fix(plugins/dom): add popover api props to 'no-unknown-property', closes #855 by @Rel1cx in #865
- fix(plugins/debug): 'is-from-react' use correct settings when calling 'isInitializedFromReact', by @Rel1cx
- feat(plugins/naming-convention): add 'ignoreFilesWithoutCode' option to 'filename-extension'
- refactor(plugins/x): xhtml entities should be allowed inside of 'no-useless-fragment', closes: #850
- fix(plugins/eslint-plugin): unexpected top-level property 'name' in legacy presets, closes #863
- fix(plugins/eslint-plugin): rules list in 'debug' and 'disable-debug' presets
- fix(plugins/x): 'no-leaked-conditional-rendering' report empty string, closes #853 by @Rel1cx in #857
- refactor: update the default behavior of import check, closes #858 by @Rel1cx in #860
- feat(plugins/x): add
jsx-no-duplicate-props
by @Rel1cx in #851
- docs: use correct link for
prefer-react-namespace-import
in rule list by @rakleed in #849
- feat(plugins/react-x): add
jsx-uses-vars
, closes #834 by @Rel1cx in #845 - feat(plugins/react-dom): add
no-unknown-property
, closes #846 by @Rel1cx - feat: add
recommended-typescript
andrecommended-typescript-legacy
presets by @Rel1cx
- Update
@typescript-eslint
's packages to^8.12.2
- Update
@typescript-eslint
's packages to^8.12.1
- feat: added code fixer to
react-x/avoid-shorthand-boolean
andreact-x/prefer-shorthand-fragment
by @Rel1cx
- fix(plugins/react-x): respect semicolon by @hyoban in #841
- fix(utilities/ast): added missing ts
as
andsatisfies
expressions handling togetFunctionIdentifier
by @Rel1cx , closes #843
- feat: add support for constructors in
hooks-extra/prefer-use-state-lazy-initialization
by @imjordanxd in #829 - feat: add
prefer-react-namespace-import
, closes #803 by @imjordanxd in #832 - feat: add support for
allowExpressions
inno-useless-fragment
by @imjordanxd in #836
- fix: Fix false positives when 'web-api/no-leaked-event-listener' passes a signal to an intermediate variable, closes #838
- docs: Update
hooks-extra-no-direct-set-state-in-use-effect.mdx
by @neovov in #831 - docs: use a standard mono-width font for the docs, closes #835 by @Rel1cx in #837
- Undeprecate
hooks-extra-no-direct-set-state-in-use-layout-effect
and remove it from recommended presets, closes #839 by @Rel1cx in #840
Full Changelog: https://github.com/Rel1cx/eslint-react/compare/v1.14.3...v1.15.0
- Update
@typescript-eslint
's packages to^8.7.0
- Update
@typescript-eslint
's packages to^8.6.0
- Fixed false positives in rule
web-api/no-leaked-resize-observer
- Fixed modular plugins missing default export
- Fixed component name detection when the component name starts with a underscore
- Update
@typescript-eslint
's packages to^8.5.0
- Fixed
hooks-extra/no-unnecessary-use-callback
andhooks-extra/no-unnecessary-use-memo
false positives when there are references from nested scopes
- Added
web-api/no-leaked-resize-observer
rule to prevent leakedResizeObserver
hooks-extra/no-redundant-custom-hook
should allow custom Hooks with empty body
- Rename
debug/react-hooks
todebug/hook
- Rename
hooks-extra/ensure-custom-using-hooks
tohooks-extra/no-redundant-custom-hook
- Rename
hooks-extra/ensure-use-memo-has-non-empty-deps
tohooks-extra/no-unnecessary-use-memo
- Rename
hooks-extra/ensure-use-callback-has-non-empty-deps
tohooks-extra/no-unnecessary-use-callback
- Upgrade
@typescript-eslint
's packages to^8.4.0
(The rules that were renamed in this release will still be available until the next major update to avoid breaking changes.)
- Added
useLayoutEffect
anduseInsertionEffect
support tohooks-extra/no-direct-set-state-in-use-effect
- Deprecate rule
hooks-extra/no-direct-set-state-in-use-layout-effect
in favor ofhooks-extra/no-direct-set-state-in-use-effect
(the previous rule will still be available until the next major update to avoid breaking changes)
- Added support for detecting event listeners removed by abort signal in rule
web-api/no-leaked-event-listener
- Fixed
no-duplicate-key
rule false positives when the key is a variable - Fixed
web-api/no-leaked-set-timeout
andweb-api/no-leaked-set-interval
false positives when a timer is assigned to a variable declared bylet
but not initialized
- Added support for detecting event listeners removed by abort signal in rule
web-api/no-leaked-event-listener
- Fixed
no-duplicate-key
rule false positives when the key is an variable - Fixed
web-api/no-leaked-set-timeout
andweb-api/no-leaked-set-interval
false positives when a timer is assigned to a variable declared bylet
but not initialized
- Allow upper case letters in the rule
naming-convention/component-name
when the component name is less than 4 characters, e.g.UI
,CSS
,SVG
- Added type declarations for
react-x
settings to the@typescript-eslint/utils/ts-eslint
module via theSharedConfigurationSettings
interface
- Improve the performance of the
no-missing-key
andno-duplicate-key
rules - Upgrade
@typescript-eslint
's packages to^8.3.0
- Add the options
allowAllCaps
,allowNamespace
,allowLeadingUnderscore
tonaming-convention/component-name
and set their default values tofalse
- Normalize the component name in rule
naming-convention/component-name
before checking it against the pattern
- Added
hooks-extra
rules torecommended
andrecommended-legacy
presets
- Added
eslint-plugin-react-web-api
- A plugin that provides rules for interacting with Web APIs in React applications - Added
web-api/no-leaked-timeout
rule to prevent leakedsetTimeout
- Added
web-api/no-leaked-interval
rule to prevent leakedsetInterval
- Added
web-api/no-leaked-event-listener
rule to prevent leakedaddEventListener
- Added
web-api
andweb-api-legacy
presets to enable all rules provided byeslint-plugin-react-web-api
- Added
react-web-api/no-leaked-event-listener
torecommended
andrecommended-legacy
presets
- Improve performance by skipping unnecessary checks when possible
- Improve dts generation of the
@eslint-react/eslint-plugin
package - Improve website and documentation
- Upgrade
@typescript-eslint
's packages to^8.2.0
- Fixed
hooks-extra/prefer-use-state-lazy-initialization
false positive when using an initializer function
- Improve rule
no-implicit-key
error marker position and range - Upgrade
@typescript-eslint
's packages to^8.1.0
- Improve website and documentation
- Added
disable-type-checked
anddisable-type-checked-legacy
presets to disable all type-checked rules
- Rename
off-dom
andoff-dom-legacy
presets todisable-dom
anddisable-dom-legacy
(the old names will still be available until the next major update to avoid breaking changes)
- Fixed
dom/no-missing-iframe-sandbox
false positive when thesandbox
attribute is set tosandbox=""
- Fixed
all
andall-legacy
presets not includinghooks-extra
rules
- Add
core
preset that includes the most essential rules
- Upgrade
@typescript-eslint
's packages to8.0.1
- Fixed legacy presets not being exported correctly in
@eslint-react/eslint-plugin
- Enhance rule
hooks-extra/no-direct-set-state-in-use-effect
andhooks-extra/no-direct-set-state-in-use-layout-effect
to supportset
function directly passed touseCallback
anduseMemo
without explicitly calling it - Improve website and documentation
- Fixed
ESLintReactSettings
type not being exported correctly - Fixed the
set
function calls that are wrapped in auseMemo
oruseCallback
like hook not being detected byhooks-extra/no-direct-set-state-in-use-effect
andhooks-extra/no-direct-set-state-in-use-layout-effect
- Upgrade
@typescript-eslint
's packages to8.0.0
- Improve website and documentation
- Fixed the spread attributes support for dom related rules
- Fixed the issue where the overridden value was retrieved when there were duplicate attributes on a JSX element
- Rule
no-leaked-conditional-rendering
now allows a falsy boolean literal to be used on the left side of the logical expression - Tweaked the default settings shipped with various presets
- Overall performance improvements
- Add
settings["react-x"].polymorphicPropName
setting to specify the name of the prop that is used to determine the component type
- Dropped the current incomplete lint support for
React.createElement
to improve performance and subsequent code maintainability
- Add
controlled
setting tosettings["react-x"].additionalComponents
'attributes
object to set whether it is controlled or not - Add glob support to
settings["react-x"].additionalComponents
'name
setting - Add default settings for
react-x
settings to presets - Undeprecate rule
no-implicit-key
and improve its usefulness - Undeprecate rule
no-complicated-conditional-rendering
and rename it tono-complex-conditional-rendering
(the previous rule will still be available until the next major update to avoid breaking changes)
no-direct-set-state-in-use-(layout?)-effect
should warn only for theset
function
- Remove
no-direct-set-state-in-use-(layout?)-effect
from recommended presets
- Revert
changeas this format is not supported by all package managers@typescript-eslint
's packages independencies
to"^7.16.1 || ^rc-v8"
- Add rule
no-prop-types
- Add rule
no-default-props
- Add experimental
settings["react-x"].additionalComponents
settings (currently only theno-unsafe-target-blank
rule uses it, but more rules will use it in the future)
- Add rule
no-prop-types
to recommended presets - Add rule
no-default-props
to recommended presets - Remove rule
no-useless-fragment
from recommended presets - Optimize performance of rule
no-create-ref
- Change
@typescript-eslint
' packages independencies
to"^7.16.1 || ^rc-v8"
- Fix false positives and negatives in rule
hooks-extra/no-direct-set-state-in-use-effect
- Fix false positives and negatives in rule
hooks-extra/no-direct-set-state-in-use-layout-effect
- Fix rule
prefer-read-only-props
reports only the first component in a file
- Improve website and documentation
- Fix rule
prefer-read-only-props
that was accidentally added to the recommended type-checked presets - Fix false negatives in rule
hooks-extra/no-direct-set-state-in-use-effect
when callset
function inside a non-function scope - Fix false negatives in rule
hooks-extra/no-direct-set-state-in-use-layout-effect
when callset
function inside a non-function scope
- Rule
no-leaked-conditional-rendering
now supports BigInt literals on the left side of the logical expression - Rule
no-leaked-conditional-rendering
now allows a truthy number literal to be used on the left side of the logical expression - Optimize bundle size
- Add rule
hooks-extra/no-direct-set-state-in-use-effect
- Add rule
hooks-extra/no-direct-set-state-in-use-layout-effect
- Fix false positives in rule
hooks-extra/ensure-use-memo-has-non-empty-deps
when referencing component block scope - Fix false positives in rule
hooks-extra/no-unnecessary-use-callback
when referencing component block scope
- Add rule
hooks-extra/no-direct-set-state-in-use-effect
to recommended presets - Add rule
hooks-extra/no-direct-set-state-in-use-layout-effect
to recommended presets - Add rule
hooks-extra/prefer-use-state-lazy-initialization
to recommended presets
- Optimize bundle size
- Fix rule
prefer-read-only-props
false positive when usingObjectPattern
in function arguments
- Change
typescript
version inpeerDependencies
to"^4.9.5 || ^5.3.3"
- Fix rule
prefer-read-only-props
false negative when usingObjectPattern
in function arguments
- Improve website and documentation
- Add rule
prefer-read-only-props
- Downgrade
@typescript-eslint
's packages to v7, due to stability issues with v8
- Add missing dependencies to
@eslint-react/eslint-plugin
- Fix rule
no-nested-components
false negative when placing components inside JSX props
- Update
@typescript-eslint
's packages to v8 - Improve rule
no-leaked-conditional-rendering
compatibility with different versions oftypescript-eslint
- Fix rule
prefer-destructuring-assignment
false positive when the function looks like a component
- Improve
utilities/jsx/is-jsx-value
to better distinguish between normal values and JSX values - Improve
core/component-collector
to better distinguish between normal functions and components - Prevent potential function component detection related false positives
- Switch to a more appropriate value for
DEFAULT_COMPONENT_DETECTION_HINT
- Reduce the number of dependencies by inlining tree-shaking optimized code while bundling
- Deprecate
reactOptions
in favor ofreact-x
in ESLint Shared Settings
- Fix rule
no-useless-fragment
not respectingjsxPragma
settings
- Update documentation for rule
no-useless-fragment
to reflect the actual behavior of the rule
- Remove rule
no-children-prop
from recommended presets - Improve documentation for rule
no-useless-fragment
- Fix debug rules not exporting correctly in
@eslint-react/eslint-plugin
- Remove rule
prefer-shorthand-boolean
from recommended presets - Remove rule
prefer-shorthand-fragment
from recommended presets - Remove rule
prefer-destructuring-assignment
from recommended presets
- Remove
languageOptions.parser
from presets - Remove
@typescript-eslint/parser
from peer dependencies - Rule
no-leaked-conditional-rendering
: object should be considered as valid left-hand type
- Add rule
avoid-shorthand-boolean
- Add rule
avoid-shorthand-fragment
- Fix rule
dom/no-missing-button-type
false positive when usingtype
attribute in a JSX expression
- Fix components that use
getDerivedStateFromError
should not be warned by ruleno-class-component
- Update
@typescript-eslint
's packages to7.11.0
- Fix ESLint peer dependency range in
package.json
- Update
@typescript-eslint
's packages to7.9.0
- Minor improvements
- Rule
no-class-component
rule now allows class components with acomponentDidCatch
method - Settings
reactOptions
now supportsimportSource
to specify the import source for React
- Deprecate rule
no-implicit-key
because it is stylistic and opinionated - Deprecate rule
no-complicated-conditional-rendering
because it is stylistic and opinionated
- Refactor React pragma and import name retrieval utils to support custom import source
- Update
@typescript-eslint
's packages to7.8.0
- Update
react
to18.3.1
- Update
@typescript-eslint
's packages to7.7.1
- Use a wider range of peerDependencies
- Optimize error messages of rules
- Update
@typescript-eslint
's packages to7.7.0
- Update
@typescript-eslint
's packages to7.6.0
- Update
@typescript-eslint
's packages to7.4.0
- Update
@typescript-eslint
's packages to7.2.0
- Fix rule
no-component-will-receive-props
not working as expected
- Improve error messages and code samples in rule docs
- Fix rule
dom/no-render-return-value
not renamed in v1.0.0
- Improve code samples in rule docs
- Update
effect
to2.3.5
- Update
@typescript-eslint
's packages to7.0.1
- Improve diagnostic messages
- Remove needless deps from
peerDependencies
- Update
@typescript-eslint
's packages to6.21.0
- Remove needless deps from
peerDependencies
- Update
@typescript-eslint
's packages to6.20.0
- Update
effect
to2.2.3
- Update
effect
to2.2.3
- Remove needless deps from
peerDependencies
- Update
@typescript-eslint
's packages to6.20.0
- Add
off-dom
andoff-dom-legacy
presets to disable all DOM related rules
- Reduce dependencies size
- Remove rule
max-depth
- Rename rule
no-spreading-key
tono-implicit-key
- Rename rule
no-constructed-context-value
tono-unstable-context-value
- Rename rule
no-unstable-nested-components
tono-nested-components
- Switch to new name prefix of rules in
@eslint-react/eslint-plugin
- Replace
jsx/
with `` in rule names - Replace
react/
with `` in rule names - Replace
react-dom/
withdom/
in rule names - Replace
react-hooks/
withhooks-extra/
in rule names
- Replace
- Switch to new settings schema
- Put settings under
reactOptions
instead ofeslintReact
- Replace
jsx.pragma
withjsxPragma
- Replace
jsx.fragment
withjsxPragmaFrag
- Replace
react.version
withversion
- Remove
jsx.extensions
- Put settings under
- Fix rule
react-dom/no-namespace
not renamed in v1.0.0 - Fix rule
react-dom/no-void-elements-with-children
not renamed in v1.0.0
- Improve rules overview page on website
- Remove
jsx
andhooks
presets from documentation
- Improve
jsx
andjsx-legacy
presets - Improve
core
andcore-legacy
presets - Improve
recommended
andrecommended-legacy
presets - Improve
recommended-type-checked
andrecommended-type-checked-legacy
presets
- Rename rule
react/no-void-elements-with-children
toreact-dom/no-void-elements-with-children
- Rename rule
react/no-dangerously-set-innerhtml-with-children
toreact-dom/no-dangerously-set-innerhtml-with-children
- Rename rule
react/no-dangerously-set-innerhtml
toreact-dom/no-dangerously-set-innerhtml
- Rename rule
react/no-find-dom-node
toreact-dom/no-find-dom-node
- Rename rule
react/no-missing-button-type
toreact-dom/no-missing-button-type
- Rename rule
react/no-missing-iframe-sandbox
toreact-dom/no-missing-iframe-sandbox
- Rename rule
react/no-namespace
toreact-dom/no-namespace
- Rename rule
react/no-render-return-value
toreact-dom/no-render-return-value
- Rename rule
react/no-script-url
toreact-dom/no-script-url
- Rename rule
react/no-unsafe-iframe-sandbox
toreact-dom/no-unsafe-iframe-sandbox
- Rename rule
react/no-unsafe-target-blank
toreact-dom/no-unsafe-target-blank
- Make
dom
an alias ofreact-dom
preset - Make
hooks
an alias ofreact-hooks
preset - Add preset
jsx
andjsx-legacy
- Add preset
react-dom
anddom-legacy
- Add preset
core
andcore-legacy
- Add preset
react-hooks
andhooks-legacy
- Fix the lint message for rule
react-dom/no-dangerously-set-innerhtml
- Fix the name prefix for react-dom rules
- Make
dom
an alias ofreact-dom
preset - Make
hooks
an alias ofreact-hooks
preset
- Add preset
jsx
andjsx-legacy
- Add preset
dom
anddom-legacy
- Add preset
core
andcore-legacy
- Add preset
hooks
andhooks-legacy
- Rename rule
react/no-dangerously-set-innerhtml
toreact-dom/no-dangerously-set-innerhtml
- Rename rule
react/no-dangerously-set-innerhtml-with-children
toreact-dom/no-dangerously-set-innerhtml-with-children
- Rename rule
react/no-find-dom-node
toreact-dom/no-find-dom-node
- Rename rule
react/no-missing-button-type
toreact-dom/no-missing-button-type
- Rename rule
react/no-missing-iframe-sandbox
toreact-dom/no-missing-iframe-sandbox
- Rename rule
react/no-script-url
toreact-dom/no-script-url
- Rename rule
react/no-unsafe-iframe-sandbox
toreact-dom/no-unsafe-iframe-sandbox
- Rename rule
react/no-unsafe-target-blank
toreact-dom/no-unsafe-target-blank
- Remove unnecessary
parserOptions
fields from presets
- Remove unnecessary
parserOptions
fields from presets
- Add rule
react/no-access-state-in-setstate
- Improve rule
react/no-unused-state
to respect the usage ofgetDerivedStateFromProps
- Update
@typescript-eslint
's packages to6.19.0
- Add rule
react/no-access-state-in-setstate
- Update
@typescript-eslint
's packages to6.19.0
- Improve rule
react/no-unused-state
to respect the usage ofgetDerivedStateFromProps
- Improve rule
react/no-unused-state
to support checking for more cases - Improve rule
react/no-direct-mutation-state
to support checking for more cases - Improve rule
react/no-unused-class-component-members
to support checking for more cases
- Improve rule
react/no-unused-state
to support checking for more cases - Improve rule
react/no-direct-mutation-state
to support checking for more cases - Improve rule
react/no-unused-class-component-members
to support checking for more cases
- Fix bundle size is larger than expected
- Fix version format in v0.10.7's package.json
- Add rule
react/no-unused-state
- Fix an issue where
react/no-constructed-context-value
andreact/no-unstable-default-props
would report false negatives when using LogicalExpression and ConditionalExpression
- Fix an issue where
react/no-constructed-context-value
andreact/no-unstable-default-props
would report false negatives when using LogicalExpression and ConditionalExpression
- Add rule
react/no-unused-class-component-members
- Update
@typescript-eslint
's packages to6.18.0
- Add rule
react/no-unused-class-component-members
- Update
@typescript-eslint
's packages to6.18.0
- Improve rule
react/no-unstable-default-props
to support checking for ObjectPatterns within VariableDeclarators that occur on props - Improve function component detection in rule
react/no-unstable-nested-components
anddebug/function-component
- Fix same kind of error inside a component should not only be reported once in rule
react/no-create-ref
andreact/no-constructed-context-value
- Fix an issue where render functions wrapped in
useCallback
were accidentally detected as function components in rulesreact/no-unstable-nested-components
anddebug/function-component
- Improve function component detection in rule
react/no-unstable-nested-components
anddebug/function-component
- Fix an issue where render functions wrapped in
useCallback
were accidentally detected as function components in rulesreact/no-unstable-nested-components
anddebug/function-component
- Improve rule
react/no-unstable-default-props
to support checking for ObjectPatterns within VariableDeclarators that occur on props
- Fix same kind of error inside a component should not only be reported once in rule
react/no-create-ref
andreact/no-constructed-context-value
- Update
@typescript-eslint
's packages to6.17.0
- Update
@typescript-eslint
's packages to6.17.0
- Add
reactHooks.alias
setting support
- Add
reactHooks.alias
setting support
- Add
react/no-clone-element
torecommended
andrecommended-legacy
presets - Improve rule
react/no-unstable-nested-components
, make its behavior closer to react-hooks/no-nested-components - Update
@typescript-eslint
's packages to6.16.0
- Update
@typescript-eslint
's packages to6.16.0
- Add
react/no-clone-element
torecommended
andrecommended-legacy
presets - Improve rule
react/no-unstable-nested-components
, make its behavior closer to react-hooks/no-nested-components
- Add rule
jsx/max-depth
- Improve
recommended
andrecommended-legacy
presets
- Add rule
jsx/max-depth
- Improve
recommended
andrecommended-legacy
presets
- Add rule
react/ensure-forward-ref-using-ref
- Reduce false positives in rule
react/no-unstable-nested-components
- Reduce false positives in rule
debug/function-component
- Optimize
recommended
andrecommended-legacy
presets - Update
@typescript-eslint
's packages to6.15.0
- Optimize
recommended
andrecommended-legacy
presets
- Minor improvements
- Add rule
react/ensure-forward-ref-using-ref
-
Reduce false positives in rule
react/no-unstable-nested-components
-
Reduce false positives in rule
debug/function-component
- Rule
named-convention/filename-extension
renamerule
option toallow
- Fix where functions in
<Component footer={() => <div />} />
or<Component Footer={() => <div />} />
are treated as components - Fix false positive in rule
react/no-unstable-nested-components
- Fix false positive in rule
debug/function-component
-
Rules now support reading JSX extensions from
settings.eslintReact.jsx.extensions
-
Replace ❌ Incorrect and ✅ Correct with Failing and Passing in rule docs
- Update default rule option in
named-convention/filename
toPascalCase
- Minor improvements
- Rule
named-convention/filename-extension
renamerule
option toallow
✨ New
- Rule
named-convention/filename
addextensions
option - Rule
named-convention/filename-extension
addextensions
option
- Add rule
react-hooks/prefer-use-state-lazy-initialization
- Rule
named-convention/component-name
add bothstring
andobject
options support - Rule
named-convention/filename
add bothstring
andobject
options support - Rule
named-convention/filename-extension
add bothstring
andobject
options support - Rule
debug/react-hooks
reportshookCalls.length
instead ofcost
- Update
@typescript-eslint
's packages to6.14.0
- Update
@typescript-eslint
's packages to6.14.0
- Rule
named-convention/component-name
add bothstring
andobject
options support - Rule
named-convention/filename
add bothstring
andobject
options support - Rule
named-convention/filename-extension
add bothstring
andobject
options support
- Remove rule
react-hooks/prefer-use-state-lazy-initialization
fromrecommended
andrecommended-legacy
presets
- Add rule
react-hooks/prefer-use-state-lazy-initialization
- Rule
named-convention/filename-extension
switch options format from object to string
- Rule
debug/react-hooks
reportshookCalls.length
instead ofcost
- Improve rule
jsx/no-leaked-conditional-rendering
error marker position and range - Improve rule
react/no-missing-button-type
error marker position and range - Improve rule
react/no-missing-iframe-sandbox
error marker position and range - Improve rule
react/no-unsafe-iframe-sandbox
error marker position and range
- Improve rule docs
- Add rule
react/no-direct-mutation-state
- Add rule
naming-convention/use-state
- Update
recommended
andrecommended-legacy
presets - Improve rules overview page
- Add rule
react/no-component-will-update
- Add rule
react/no-unsafe-component-will-update
- Add rule
react/no-component-will-receive-props
- Add rule
react/no-unsafe-component-will-receive-props
- Add rule
react/no-set-state-in-component-did-mount
- Add rule
react/no-set-state-in-component-did-update
- Add rule
react/no-set-state-in-component-will-update
- Add rule
react/no-component-will-mount
- Add rule
react/no-unsafe-component-will-mount
@eslint-react/eslint-plugin-jsx
- Remove
allowExpressions
option from rulejsx/no-useless-fragment
- Remove
@eslint-react/jsx
- Remove
isFragmentWithOnlyTextAndIsNotChild
,isFragmentHasLessThanTwoChildren
,isFragmentWithSingleExpression
from@eslint-react/jsx
's API
- Remove
- Add rule
react/no-redundant-should-component-update
- Update Options of rule
jsx/no-useless-fragment
- Optimize bundle size