npm eslint-plugin-unicorn 66.0.0

8 hours ago

Breaking

New rules

Improvements

  • Harden some rules with type info (#3228) 1c85dd1
  • Harden array checks (#3145) 6b2de0a
  • Improve type detection in some rules (#3197) 3cb9d4b
  • Improve comment handling (#3133) d698a60
  • Expand language support for additional rules (#3176) fec53a5
  • Support non-JavaScript files in more rules (#3079) 52c1774
  • consistent-compound-words: Allow newLine word (#3117) 949e56b
  • consistent-compound-words: Improve performance (#3185) fc4e29a
  • consistent-destructuring: Stop expanding destructuring (#3115) 65afb79
  • consistent-function-scoping: Track JSX references (#3101) e0130c2
  • expiring-todo-comments: Add peer: condition (#3088) 93e9a0c
  • expiring-todo-comments: Simplify report messages (#3215) d0945e0
  • explicit-length-check: Detect length <= 0 as a zero-length check (#3071) ea471f1
  • filename-case: Add camelCaseWithAcronyms case (#3168) 1a7126e
  • filename-case: Allow acronyms in pascal case (#3125) b70cb64
  • import-style: Support node: builtins (#3207) abf805f
  • no-empty-file: Support all file extensions (#3077) c4fa5b1
  • no-for-each: Improve autofix reliability (#3213) 0116e32
  • no-for-loop: Support cached length loops (#3190) c3f79c8
  • no-invalid-argument-count: Handle TypeScript wrappers (#3179) 2639a3b
  • no-invalid-file-input-accept: Normalize legacy MIME types (#3093) 27104c0
  • no-single-promise-in-promise-methods: Autofix Promise.all first element (#3112) 50b5658
  • no-unnecessary-polyfills: Respect Browserslist config (#3122) 8b3660a
  • no-unused-properties: Support inline TypeScript object type literals (#3204) ec77d4e
  • no-useless-fallback-in-spread: Support ternary (#3083) 0b6c452
  • no-useless-spread: Check object spread in Object.assign() (#3188) c8f2bf5
  • no-useless-switch-case: Allow case null and case undefined in TypeScript files before default (#3128) 556b6a9
  • no-useless-undefined: Handle guarded indexed access (#3201) 4cd318d
  • prefer-array-flat: Stop reporting plain concat normalization (#3106) b4e5ce2
  • prefer-array-flat-map: Support .filter(…).flatMap(…) (#3199) a14375b
  • prefer-array-from-map: Support for-of array mapping (#3220) 174d5a5
  • prefer-at: Check single-character substring (#3100) 6a33b04
  • prefer-at: Prefer at() for string indexing (#3200) 2ac7dd1
  • prefer-early-return: Add autofix (#3212) 0f0ac96
  • prefer-includes: Simplify boolean array predicates (#3096) 950e137
  • prefer-math-trunc: Check parseInt (#3108) c9632b9
  • prefer-modern-dom-apis: Handle .replaceChildren() (#3170) 27daf8e
  • prefer-number-is-safe-integer: Check legacy integer patterns (#3214) 4e50131
  • prefer-number-properties: Auto-fix isNaN/isFinite when the argument is a number (#3082) 5e27e8f
  • prefer-object-from-entries: Check for-of loops (#3221) 2123d95
  • prefer-regexp-test: Improve TypeScript support (#3193) a8338ab
  • prefer-regexp-test: Support String#search() checks (#3089) 7cef013
  • prefer-spread: Handle trivial for...of copies (#3196) dd6e4a1
  • prefer-spread: Improve concat() array detection (#3171) 0f6dc8a
  • prefer-spread: Stop checking String#split('') (#3110) a4009b1
  • prefer-string-replace-all: Allow more regex flags for string fixes (#3180) 19580d8
  • prefer-string-starts-ends-with: Detect indexOf() === 0 (#3087) 92b6d79
  • prefer-ternary: Detect let declaration with if reassignment (#3084) 7c7e724
  • prefer-ternary: Only report captured values (#3181) 6df473a
  • string-content: Ignore sql tagged templates (#3143) 3796576
  • switch-case-braces: Support single-statement option (#3182) f897537

Fixes

  • better-dom-traversing: Ignore props.children (#3177) 486d9b7
  • consistent-function-scoping: Fix loop capture false positives (#3157) 522e188
  • custom-error-definition: Preserve Error#cause (#3092) f182d63
  • max-nested-calls: Ignore JSX wrappers (#3209) 1e273dd
  • no-array-callback-reference: Ignore non-array TypeScript receivers (#3130) 64dfda9
  • no-array-method-this-argument: Fix false positives (#3219) 9aeec5e
  • no-for-loop: Guard unsafe .entries() autofixes (#3211) d5f8a89
  • no-useless-spread: Reduce false positives (#3167) 2c19771
  • no-useless-undefined: Ignore TypeScript call arguments (#3095) 51a7fd6
  • prefer-array-some: Ignore non-array find checks (#3208) 5d9dae2
  • prefer-at: Ignore DOM collection receivers (#3102) 4db8f05
  • prefer-global-this: Don't flag typeof existence checks (#3070) 2767382
  • prefer-https: Ignore well-known XML namespace URIs (#3076) 40df180
  • prefer-native-coercion-functions: Ignore type predicates (#3144) d86a467
  • prefer-switch: Ignore literal discriminants (#3103) 512a534
  • prefer-type-error: Don't flag typeof x === 'undefined' existence checks (#3067) 3676ba1
  • prevent-abbreviations: Ignore e2e and a11y (#3069) febc992
  • switch-case-braces: Fix incorrect autofix with comment (#3172) 9368d98

v65.0.1...v66.0.0

Don't miss a new eslint-plugin-unicorn release

NewReleases is sending notifications on new releases.