Releases: jsx-eslint/eslint-plugin-react
Releases · jsx-eslint/eslint-plugin-react
v7.15.0
Added
- add
jsx-no-useless-fragment
rule (#2261 @golopot) - [
jsx-handler-name
][]: allowfalse
to disableeventHandlerPrefix
/eventHandlerPropPrefix
(#2410 @tanmoyopenroot) sort-comp
: addstatic-variables
grouping (#2408 @vedadeepta)jsx-no-literals
: AddallowedStrings
option (#2380 @benhollander)no-multi-comp
: Added handling forforwardRef
andmemo
wrapping components declared in the same file (#2184 @jenil94)jsx-pascal-case
:allowAllCaps
option now allowsSCREAMING_SNAKE_CASE
(#2364 @TylerR909)
Fixed
jsx-indent
: Fix false positive when a jsx element is the last statement within a do expression (with tests) (#2200 @Kenneth-KT)jsx-curly-brace-presence
: fix jsx tags in braces (#2422 @tanmoyopenroot)display-name
: Fix false positives (#2399 @BPScott)jsx-curly-brace-presence
: report unnecessary curly braces with children on next line (#2409 @vedadeepta)no-unused-prop-types
: false positive with callback (#2375 @golopot)- Fix prop-types detection collision on renamed props (#2383 @yannickcr)
jsx-sort-props
: use localeCompare rather than comparison operator (#2391 @tanmoyopenroot)jsx-pascal-case
: allow one-letter-named components (#2395 @Haegin)jsx-wrap-multilines
: fix incorrect formatting (#2392 @tanmoyopenroot)require-optimization
: fix when using arrow function in class components (#2385 @jenil94)no-deprecated
: Deprecate cWM/cWRP/cWU lifecycle methods since React 16.9.0 (#2378 @meowtec)jsx-key
: improve docs and confusing error message (#2367 @kaykayehnn)- Recognize props wrapped in flow $ReadOnly<> utility type (#2361 @lukeapage)
prop-types
: false positive with setState updator (#2359 @golopot)
Changed
- [Docs]
no-access-state-in-setstate
: update grammar ([#2418][] @neaumusic) jsx-curly-brace-presence
,jsx-one-expression-per-line
,no-danger-with-children
: addisWhiteSpaces
tolib/util/jsx
(#2409 @vedadeepta)
v7.14.3
Fixed
- Fix
prop-types
to ignore validation when Flow indexers are used (#2330 @yannickcr) - Fix error being thrown after the first warning when react version cannot be detected (#2336 @abhishekdev)
- Fix component detection when
memo
andforwardRef
are used together (#2349 @yannickcr)
Changed
v7.14.2
v7.14.1
v7.14.0
Added
- Add
jsx-curly-newline
rule (#1493 @golopot) - Add support for nested destructuring to
prop-types
(#296 #1422 @golopot) - Add support for variables defined as props to
prop-types
andno-unused-prop-types
(#442 #833 #1002 #1116 #1257 #1764 @golopot) - Add
checkFragmentShorthand
option tojsx-key
(#2316 @kaykayehnn)
Fixed
- Fix
no-did-mount-set-state
andno-did-update-set-state
to handle cDU and cDM defined as class properties (#1595 @jaaberg) - Fix
sort-prop-types
cash when a shape PropType is defined in a variable (#1749 @alexzherdev) - Fix
no-unused-state
false positive when using state of non-lifecycle method (#2274 @golopot) - Fix
static-property-placement
false positive when accessing static property inside method (#2283 @dmason30) - Fix
prop-type
detection for annotated props with default value (#2298 @yannickcr)
Changed
- Add ESLint 6.0.0 as valid peerDependency (@yannickcr)
- Improve
no-render-return-value
performance (#2259 @golopot) - Change
jsx-sort-props
to report errors only on the identifier (#2312 @MrHen) - Change to warn only once if react version cannot be detected (#2276 @ljharb)
- Documentation improvements (#2263 @dimitropoulos, #2262 @ybiquitous, #2295 @battaglr, #2302 @Jason-Cooke, #2303 @golopot)
- Code refactoring (#2265 #2267 #2286 #2294 @golopot, @ljharb)
- Tests improvements (#2304 #1047 @golopot, @yannickcr)
v7.13.0
Added
- Make
jsx-sort-props
fully fixable (#2250, @guliashvili) boolean-prop-naming
: addvalidateNested
option to validate shape prop names (#2234, @pawelnvk)- add
static-property-placement
rule (#2193, @dmason30) - add "detect" for flow version (#2233, @jedwards1211)
jsx-indent
: AddindentLogicalExpressions
option (#2227, @mdnsk)- add
jsx-props-no-spreading
(#2191, @ashbhir) no-string-refs
: AddednoTemplateLiteral
option (#2167, @jenil94)- add
linkComponents
setting (#2116, @gbakernet) jsx-no-target-blank
: add support forlinkComponents
setting (#2116, @gbakernet)- Add
state-in-constructor
rule (#1945, @lukyth) - Add
prefer-read-only-props
rule (#2110, @golopot) no-unescaped-entities
: more friendly error message; add config to adjust (#2016, @stevemao)
Fixed
jsx-props-no-multi-spaces
: support generic components (ts) (#2256, @mateuszsokola)prop-types
: fix case with destructuring and default param (#2246, @golopot)prefer-stateless-function
: Ignoring pure components without props and context usage (#2238, @pawelnvk)propTypes
: resolveSuperParameterPropsType: add null check (#2232, @jedwards1211)self-closing-comp
: stop reporting single-line spaces (#2210, @golopot)require-render-return
: more accurate report location (#2229, @golopot)sort-prop-types
: Fix sorting props with numeric keys (#2230, @pawelnvk)display-name
: fix false negative around nested functions (#2225, @dwelle)no-unknown-property
: fix case like<Foo.bar>
(#2207, @golopot)jsx-curly-brace-presence
: accept multiline template string (#2203, @golopot)jsx-one-expression-per-line
: fix when using tabs (#2198, @Ohar)prop-types
: Fix false positive on computed member expression (#2202, @golopot)jsx-sort-default-props
: fix case with spread (#2182, @VincentLanglet)no-this-in-sfc
: Fix false positive on SFC defined as object property (#2147, @yannickcr)sort-comp
: correctly recognize instance variables declared without explicit value (#2183, @yannickcr)no-unused-state
: fix set state callback destructing & state use inside callback ([#2151][], @barakyosi)no-multi-comp
: correctly ignore wrapped stateless components: (#2145, @yannickcr)display-name
: avoid crash on for..of (#2137, @ljharb)
Changed
- [Docs]
no-access-state-in-setstate
: Use syntax highlighting for examples ([#2160][], @pReya) - [Docs]
jsx-fragments
: add "fixable" note (#2143, @joshunger) - [Docs] Added shared settings info, React version default note (#2180, @samsch)
- [Tests]
jsx-curly-spacing
: add regression test case (#2206, @ColCh)
v7.12.4
Fixed
no-unused-prop-types
: avoid a crash (#2131, @ljharb)prop-types
: avoid further crashes from nonexistent nodes in unusedPropTypes (#2127, @ljharb)prop-types
: Read name of callee object (#2125, @CrOrc)prop-types
: Ignore reassignments when matching props declarations with components (#2051, #1957, @yannickcr)prop-types
,no-unused-prop-types
,require-default-props
: Detect components with return statement in switch/case (#2118, @yannickcr)
Changed
v7.12.3
Fixed
jsx-indent
: Prevent crash on valueless props (#2120, @jomasti)jsx-fragments
: avoid crashing on self-closing fragments (#2113, @alexzherdev)no-unused-prop-types
: Fix propType detection inside class bodies (#2115, @drx)no-unused-prop-types
: fix issue with propTypes misclassifying props (#2111, @drx)display-name
: fix false positive forReact.memo
(#2109, @jomasti)
Changed
- [Docs] add a missing comma in the JSON settings (#2117, @haideralsh)
- [Docs] update README to document React version detection (#2114, @mohsinulhaq)
v7.12.2
v7.12.1
Fixed
no-unused-state
: Fix crash with class fields (#2098, @jomasti)prop-types
: Fix false positives inside lifecycle methods (#2099, @jomasti)jsx-max-depth
: avoid a crash (#2102, @ljharb)jsx-wrap-multilines
: avoid crash when no trailing newline (#2100, @ljharb)
Changed
- Fix CHANGELOG.md (#2097, @alexzherdev)