Releases: jsx-eslint/eslint-plugin-react
Releases · jsx-eslint/eslint-plugin-react
v7.31.0
Added
jsx-newline
: addallowMultiline
option when prevent option is true (#3311 @TildaDares)forbid-dom-props
: adddisallowedFor
option (#3338 @TildaDares)
Fixed
jsx-no-literals
: properly error on children with noAttributeStrings: true (#3317 @TildaDares)jsx-key
: catch key errors inside conditional statements (#3320 @TildaDares)display-name
: Accept forwardRef and Memo nesting in newer React versions (#3321 @TildaDares)jsx-key
: avoid a crash from optional chaining from #3320 (#3327 @ljharb)jsx-key
: avoid a crash on a non-array node.body from #3320 (#3328 @ljharb)display-name
: fix false positive for assignment of function returning null (#3331 @apbarrero)display-name
: fix identifying_
as a capital letter (#3335 @apbarrero)require-default-props
: avoid a crash when function has no props param (#3350 @noahnu)display-name
, component detection: fix HOF returning null as Components (#3347 @jxm-math)forbid-prop-types
: Ignore objects that are not of type React.PropTypes (#3326 @TildaDares)display-name
, component detection: fix false positive for HOF returning only nulls and literals (#3305 @golopot)jsx-no-target-blank
: False negative when rel attribute is assigned using ConditionalExpression (#3332 @V2dha)jsx-no-leaked-render
: autofix nested "&&" logical expressions (#3353 @hduprat)jsx-sort-props
: sorted attributes now respect comments (#3358 @ROSSROSALES)
Changed
- [Refactor]
jsx-indent-props
: improved readability of the checkNodesIndent function (#3315 @caroline223) - [Tests]
jsx-indent
,jsx-one-expression-per-line
: add passing test cases (#3314 @ROSSROSALES) - [Refactor]
boolean-prop-naming
,jsx-indent
: avoid assigning to arguments (#3316 @caroline223) - [Docs]
sort-comp
: add class component examples (#3339 @maurer2) - [Docs]
jsx-no-useless-fragment
: add more examples of correct code (#3349 @karlhorky) - [Docs]
jsx-boolean-value
: add jsdoc types for helper functions (#3344 @caroline223) - [readme] remove dead codeclimate badge, add actions badge (@ljharb)
- [readme] Remove dead david-dm badge (#3262 @ddzz)
- [Refactor]
jsx-closing-bracket-location
,jsx-no-bind
: fix eslint issues (#3351 @caroline223) - [Tests]
function-component-definition
: add passing test cases (#3355 @TildaDares) - [Docs]
jsx-no-target-blank
: Fix link to link-type-noreferrer (#3319 @Luccasoli) - [Docs] document which rules provide suggestions (#3359, #3365 @bmish)
- [Docs] Consistent rule descriptions and doc sections (#3361 @bmish)
- [Docs] Standardize deprecated rule notice (#3364 @bmish)
- [Docs] Fix typos (#3366 @bmish)
- [Docs] Add markdownlint for documentation formatting consistency (#3367 @bmish)
- [Docs] Add config notice to rule docs (#3362 @bmish)
v7.30.1
7.30.1 - 2022.06.23
Fixed
display-name
: fix false positive for HOF returning only nulls (#3291 @golopot)jsx-no-leaked-render
: avoid unnecessary negation operators and ternary branches deletion (#3299 @Belco90)display-name
: fix false positive when using memo (#3304 @golopot)
Changed
- [Docs]
jsx-tag-spacing
: rename option from #3264 (#3294 @ljharb) - [Docs]
jsx-key
: split the examples (#3293 @ioggstream)
v7.30.0
Added
destructuring-assignment
: add optiondestructureInSignature
(#3235 @golopot)no-unknown-property
: Allow crossOrigin on image tag (SVG) (#3251 @zpao)jsx-tag-spacing
: Addmultiline-always
option (#3260, #3264 @Nokel81)function-component-definition
: replacevar
byconst
in certain situations (#3248 @JohnBerd @SimeonC)- add
jsx-no-leaked-render
(#3203 @Belco90) require-default-props
: add optionfunctions
(#3249 @nix6839)
Fixed
hook-use-state
: Allow UPPERCASE setState setter prefixes (#3244 @duncanbeevers)propTypes
: addVFC
to react generic type param map (#3230 @dlech)no-unused-state
: avoid a crash (#3258 @WillyLiaoWH @ljharb)jsx-no-useless-fragment
: use proper apostrophe in error message (#3266 @develohpanda)propTypes
: handle imported types/interface in forwardRef generic (#3280 @vedadeepta)button-has-type
: fix exception for<button type>
(#3255 @meowtec)no-unstable-nested-components
: Improve error message and catch React.memo() (#3247 @zacharyliu)
Changed
- [readme] remove global usage and eslint version from readme (#3254 @aladdin-add)
- [Refactor] fix linter errors (#3261 @golopot)
- [Docs]
no-unused-prop-types
: fix syntax errors (#3259 @mrdulin) - [Refactor] improve performance for detecting function components (#3265 @golopot)
- [Refactor] improve performance for detecting class components (#3267 @golopot)
- [Refactor]
no-deprecated
: improve performance (#3271 @golopot) - [Refactor]
no-did-mount-set-state
,no-did-update-set-state
,no-will-update-set-state
: improve performance (#3272 @golopot) - [Refactor] improve performance by avoiding unnecessary
Components.detect
(#3273 @golopot) - [Refactor] add
isParenthesized
AST util (#3203 @Belco90) - [Docs]
default-props-match-prop-types
,require-default-props
,sort-prop-types
: fix typos (#3279 @nix6839) - [Refactor] improve performance of rule merging (#3281 @golopot)
- [Refactor] improve performance of component detection (#3276 @golopot)
v7.29.4
Fixed
no-unused-state
: avoid a crash on a class field gDSFP (#3236 @ljharb)boolean-prop-naming
: handle React.FC, intersection, union types (#3241 @ljharb)
v7.29.3
Fixed
no-unused-state
: avoid a crash on type-only gDSFP declarations (#3225 @ljharb)jsx-curly-brace-presence
: the string "never" defaults topropElementValues
asignore
(#3228 @ljharb)propTypes
: addVFC
to react generic list (#3230 @ljharb)
v7.29.2
jsx-curly-brace-presence
: avoid warning on curlies containing quote characters (#3214 @ljharb)jsx-indent
: do not report on non-jsx-returning ternaries that contain null (#3222 @ljharb)jsx-indent
: properly report on returned ternaries with jsx (#3222 @ljharb)no-array-index-key
: detect named-importedcloneElement
/createElement
(#3213 @ljharb)
v7.29.1
v7.29.0
Added
- add
hook-use-state
rule to enforce symmetric useState hook variable names (#2921 @duncanbeevers) jsx-no-target-blank
: Improve fixer with optionallowReferrer
(#3167 @apepper)jsx-curly-brace-presence
: add "propElementValues" config option (#3191 @ljharb)- add
iframe-missing-sandbox
rule (#2753 @tosmolka @ljharb) no-did-mount-set-state
,no-did-update-set-state
: no-op with react >= 16.3 (#1754 @ljharb)jsx-sort-props
: support multiline prop groups (#3198 @duhamelgm)jsx-key
: addwarnDuplicates
option to warn on duplicate jsx keys in an array (#2614 @ljharb)jsx-sort-props
: addlocale
option (#3002 @ljharb)
Fixed
prop-types
,propTypes
: add support for exported type inference (#3163 @vedadeepta)no-invalid-html-attribute
: allow 'shortcut icon' onlink
(#3174 @Primajin)prefer-exact-props
improve performance forIdentifier
visitor (#3190 @meowtec)propTypes
: Handle TSTypeReference in no-unused-prop-type (#3195 @niik)sort-prop-types
: avoid repeated warnings of the same node/reason (#519 @ljharb)jsx-indent
: Fix indent handling for closing parentheses (#620 @stefanbuck])- [
prop-types
/propTypes
]: follow a returned identifier to see if it is JSX (#1046 @ljharb) no-unused-state
: TS: supportgetDerivedStateFromProps
as an arrow function (#2061 @ljharb)no-array-index-key
: catch.toString
andString()
usage (#2813 @RedTn)function-component-definition
: do not break on dollar signs (#3207 @ljharb)prefer-stateless-function
: avoid a crash insidedoctrine
(#2596 @ljharb)prop-types
: catch infinite loop (#2861 @ljharb)forbid-prop-types
: properly report name in error message; check undestructured arguments (#2945 @ljharb)
Changed
- [readme] change [
jsx-runtime
] link from branch to sha (#3160 @tatsushitoji) - [Docs] HTTP => HTTPS (#3133 @Schweinepriester)
- [readme] Some grammar fixes (#3186 @JJ)
- [Docs]
jsx-no-target-blank
: Improve readme (#3169 @apepper) - [Docs]
display-name
: improve examples (#3189 @golopot) - [Refactor]
no-invalid-html-attribute
: sort HTML_ELEMENTS and messages (#3182 @Primajin) - [Docs]
forbid-foreign-prop-types
: documentallowInPropTypes
option (#1815 @ljharb) - [Refactor]
jsx-sort-default-props
: remove unnecessary code (#1817 @ljharb) - [Docs]
jsx-no-target-blank
: fix syntax highlighting (#3199 @shamrin) - [Docs]
jsx-key
: improve example (#3202 @chnakamura) - [Refactor]
jsx-key
: use more AST selectors (@ljharb)
New Contributors
- @tatsushitoji made their first contribution in #3160
- @Schweinepriester made their first contribution in #3133
- @Primajin made their first contribution in #3174
- @apepper made their first contribution in #3167
- @JJ made their first contribution in #3186
- @niik made their first contribution in #3195
- @tosmolka made their first contribution in #2753
- @stefanbuck made their first contribution in #620
- @kolpax made their first contribution in #1691
- @duhamelgm made their first contribution in #3198
- @shamrin made their first contribution in #3199
- @chnakamura made their first contribution in #3202
Full Changelog: v7.28.0...v7.29.0
v7.28.0
What's Changed
- [New] component detection: track React imports by @duncanbeevers in #3149
- [New]
function-component-definition
: supportnamedComponents
option being an array by @petersendidit in #3129 - [Test] parsers.all augments suggestion code output by @duncanbeevers in #3154
- [Fix]
jsx-indent-props
: Resetline.isUsingOperator
correctly after ternary (#3146) by @tobiaswaltl in #3157 - [New] Component detection: add
util.isReactHookCall
by @duncanbeevers in #3156
New Contributors
- @tobiaswaltl made their first contribution in #3157
Full Changelog: v7.27.1...v7.28.0
v7.27.1
What's Changed
- [Fix]
no-unused-class-component-methods
: add getChildContext lifecycle method by @yoyo837 in #3136 - [readme] fix syntax typo by @moselhy in #3141
- [Fix]
prop-types
: fix false positives on renames in object destructuring by @golopot in #3142
New Contributors
Full Changelog: v7.27.0...v7.27.1