Releases: sindresorhus/eslint-plugin-unicorn
Releases Β· sindresorhus/eslint-plugin-unicorn
v64.0.0
New rules
consistent-template-literal-escape(#2866) 55444b4no-useless-iterator-to-array(#2872) 641b88cprefer-simple-condition-first(#2902) b0279ddswitch-case-break-position(#2910) 8d5d487
Improvements
- Support TypeScript type assertions in many rules (#2909) 6b41299
text-encoding-identifier-case: Support template literals (#2905) 9448c8cprefer-math-min-max: Ignore Date objects (#2903) cd53d9eprevent-abbreviations: Handle exported TS interfaces and enums (#2898) 6dc01d2no-array-callback-reference: Skip TypeScript type predicate callbacks (#2897) 02364c8prefer-spread: Skip autofix when it would drop comments (#2896) 6ff1467no-useless-undefined: Flagreturn undefinedfor explicit undefined return types (#2876) 41fc9c2no-unnecessary-polyfills: Improve performance (#2874) c88bf29expiring-todo-comments: AddignoreDatesoption (#2892) 95a288bprevent-abbreviations: Recognize jQuery 42f5364prefer-object-from-entries: Avoid auto-fixing generic reduce (#2878) bea9b20
Fixes
expiring-todo-comments: Fix partial version comparison (#2895) 51390e9consistent-destructuring: Fix false positive for nested rest destructuring (#2894) 1cddfb5consistent-destructuring: Fix false positive after reassignment (#2893) c7f57d0consistent-function-scoping: Fix TypeScript false positives for lexicalthis(#2885) a383657custom-error-definition: Fix class field autofix (#2887) 1359726explicit-length-check: Fix||fallback false positives (#2889) 84246ecexplicit-length-check: Avoid unsafe autofix in negated comparisons (#2883) 73b043bimport-style: Fix false positive for type-only import (#2891) aea9954no-unused-properties: Fix for JSX member access (#2890) 0ff698bbetter-regex: Fix empty-pattern autofix (#2881) c201987prefer-global-this: Fix for window-specificinchecks (#2879) 6bf7537prefer-native-coercion-functions: Fix false positive for TS type predicates (#2888) 4c4b565prefer-set-has: Fix string false positives (#2882) c230c22prefer-top-level-await: Fix false positive withPromise.all(#2884) 67faa7a
v63.0.0
New rules
Improvements
- Support ESLint 10 (#2823) bd0901b
prefer-set-size: AddArray.from()support (#2857) e556143prefer-bigint-literals: Support signed numbers and strings (#2784) a332a50prefer-export-from: Fix type-import being removed when using namespace import (#2771) ab4b779prefer-spread: Fix: Skip TypedArray and ArrayBuffer constructor calls (#2871) 42a558fno-array-sort: Ignore.sort()calls with non-function arguments (#2862) cbb2377prefer-add-event-listener: Don't autofix non-function assignments (#2865) 989ec61explicit-length-check: Ignore||with string fallback value (#2861) 4806f7eno-unnecessary-polyfills: Fix false positive for graduatedesnextfeatures (#2864) d6c13abno-for-loop: Skip auto-fix for string types when.entries()would be needed (#2869) 08a591aimport-style: Fix crash onexport {x}withoutfromclause (#2868) 141c8c5expiring-todo-comments: Should not flag ESLint disable comments (#2828) 3568dafno-useless-collection-argument: Use suggestions to remove empty array with comments (#2838) c0d0687prefer-set-has: CheckIterator#toArray()andString#split()(#2829) ab8970eno-useless-spread: Fix false positive onIterator(#2831) 994e31cisolated-functions: Ignore TypeScript types (#2822) c3479c0prefer-string-raw: Exclude inline snapshot (#2811) 6e7f93cconsistent-assert: Explicitly check specifier node type (#2803) 396a8fa
v62.0.0
New rules
no-immediate-mutation(#2787) e1c7d2eno-useless-collection-argument(#2777) 2d07c9aprefer-response-static-json(#2778) ffe5943
Improvements
text-encoding-identifier-case: AddwithDashoption (#2780) 9025386no-useless-undefined: Check oneundefinedat a time (#2792) 27f7509prefer-single-call: Check optional chaining (#2788) 8a132actext-encoding-identifier-case: Enforce'utf-8'inform[acceptCharset]andTextDecoder(#2785) 46b3974prefer-node-protocol: Handle TypeScript import types (#2774) 13a37a0no-array-for-each: IgnoreforEachfor Effect library (#2783) 2ef6f83prefer-string-raw: Ignore more places that requires a string (#2776) 43bc429prefer-string-raw: Add support for template literals (#2691) 52723a2prefer-global-this: AddnavigationtowindowSpecificAPIs(#2770) 0c93998prefer-code-point: Report cases whereString.fromCharCodeis not called directly (#2766) 1d682a1no-useless-spread: Safely remove empty array and object (#2764) 7aeabab
Fixes
v61.0.2
v61.0.1
v61.0.0
New rules
prefer-bigint-literals(#2722) 1f4cb8aprefer-classlist-toggle(#2731) 5f27ec2require-module-attributes(#2725) 5f275e2no-array-sort(#2713) b70d1e8
Improvements
- Add
unopinionatedconfig (#2715) c13d09b - Improve compatibility with optional chaining (#2727) 60b2ec5
no-array-reduce: Report optional chaining and calling of.reduce()(#2721) caa1f8bprefer-type-error: Ignore error type check (#2729) d12fc01
Fixes
v60.0.0
Breaking
New rules
prefer-class-fields(#2512) 4c82dc1no-array-reverse(#2677) b051302require-module-specifiers(#2686) 2a8e152no-useless-error-capture-stack-trace(#2676) fc900b6
Improvements
Fixes
no-array-callback-reference: Fix optional chaining expressions being ignored (#2694) ad27922no-unnecessary-await: Fix handling of experimental pipeline operator (#2658) 2b8ebe5
v59.0.1
v59.0.0
Breaking
- Rename
no-array-push-pushrule toprefer-single-call(#2617) e117783 - Rename
no-length-as-slice-endrule tono-unnecessary-slice-end(#2614) 1922df1
New rules
- Add
prefer-import-meta-properties(#2607) 1f6e172 - Add
no-unnecessary-array-flat-depth(#2618) c63e698 - Add
no-unnecessary-array-splice-count(#2614) 1922df1
Improvements
- Support
Float16Array(#2622) 9e50568 prefer-node-protocol: Supportprocess.getBuiltinModule()(#2611) 056364dno-unnecessary-slice-end: Support checkingInfinity(#2614) 1922df1
v58.0.0
Potentially breaking
Improvements
escape-case: Add case option (#2559) 0f6048cnumber-literal-case: AddhexadecimalValueoption (#2559) 0f6048cprevent-abbreviations: PreserveiOS(#2560) e8798da
Fixes
no-unnecessary-polyfills: Fix browserslist field name (#2603) 1a4c76fno-unnecessary-polyfills: Fix crash on checkinges6-errormodule (#2582) 66de41ano-accessor-recursion: Fix exception when used in CommonJS (#2574) ca1e432