Releases: sindresorhus/eslint-plugin-unicorn
Releases · sindresorhus/eslint-plugin-unicorn
v26.0.0
New rules
no-new-array(#992) 48390c1prefer-array-index-of(#920) 517a782prefer-regexp-test(#970) 7b74b40consistent-destructuring(#325) 32bd31c
Improvements
- Remove
import-indexrule from recommended preset (#977) ff1cd2e prefer-string-starts-ends-with: Remove check onString#match()(#1002) c9fa8b1no-array-callback-reference: IgnoreAwaitExpressionexceptreduceandreduceRight(#814) 4c2b00b
Fixes
v25.0.1
v25.0.0
New rules
Renamed rules
We improved the naming and name consistency of some rules. Sorry about the churn.
If you use the recommended preset and you're not overriding any rules, you don't need to do anything.
no-fn-reference-in-iterator→no-array-callback-referenceno-array-instanceof→no-instanceof-arrayno-reduce→no-array-reduceprefer-dataset→prefer-dom-node-datasetprefer-flat-map→prefer-array-flat-mapprefer-replace-all→prefer-string-replace-allprefer-starts-ends-with→prefer-string-starts-ends-withprefer-text-content→prefer-dom-node-text-contentprefer-trim-start-end→prefer-string-trim-start-endprefer-event-key→prefer-keyboard-event-keyprefer-node-append→prefer-dom-node-appendprefer-node-remove→prefer-dom-node-remove
Improvements
explicit-length-check: Make rule work in many more cases (#943) f3bc798explicit-length-check: Check unsafeLogicalExpressions (#952) a1b60adexplicit-length-check: CheckBoolean(foo.length)(#951) f4577f7explicit-length-check: Check more cases (#941) 83a6453new-for-builtins: IgnoreObject(x) === xandObject(x) !== x(#944) 5c7ea92explicit-length-check: Rewrite rule (#938) 94ae87a
v24.0.0
New rules
Improvements
prevent-abbreviations: Addignoreoption (#891) 898fcb4no-useless-undefined: AddcheckArgumentsoption (#877) a1617b9consistent-function-scoping: Allow ignoring arrow functions (#932) 17bf27c- Rewrite
error-messagerule (#922) 877bef9 - Improve
prefer-query-selectorrule (#908) 635601d prevent-abbreviations: Addvar/varsreplacements (#894) 07dadf5prevent-abbreviations: Addver→versionreplacement (#870) e755cddprefer-number-properties: Supportcomputedkey ofClassPropertyMethodDefinitionProperty(#886) 769ac35prefer-optional-catch-binding: Improve output (#884) 375d11ano-null: ExcludeuseRef(null)andReact.useRef(null)(#890) 7a4dbf4prefer-number-properties: AddInfinitysupport (#874) 643169bno-console-spaces: Improve report location (#866) 190cbacno-useless-undefined: IgnoretoHaveBeenCalledWithmethod (#876) d10a641prefer-replace-all: Handleuflag (#879) d98d867no-for-loop: Improve output when using the TypeScript parser (#883) 52edd3bno-for-loop: Respect declaration kind (#878) df3f7bdno-for-loop: Only report on the for loop head part (#885) e9c6963
Fixes
- Fix
falseimport styles seen in reported problem messages (#910) d669707 import-style: Fix crash onbabel-eslintparser (#927) 9f5f721prevent-abbreviations: Fix crash with TypeScript parser (#913) 9d5eca6prefer-query-selector: Fix crash on calling without argument (#906) 36908daimport-style: Fix crash on destructing require (#904) 8335d41new-for-builtins: Remove auto-fix fornew String,new Boolean(), andnew Number()(#907) dfc1ce0
v23.0.0
New rules
- Add
prefer-math-truncrule (#851) 5ee2432 - Add
numeric-separators-stylerule (#833) 6c9b531 - Add
prefer-ternaryrule (#514) d59cf95
Improvements
explicit-length-check: Use'non-zero': 'greater-than'by default (#850) 7c5df5fprevent-abbreviations: Addfn/func->function,i/idx/j->indexreplacements (#836) e502f42consistent-function-scoping: Check anonymous functions (#835) 29ecbf6no-console-spaces: Make space position more specific (#838) e17a63fno-nested-ternary: Improve report location & message (#844) ca1afa6- Track JSX presence per-function, fixing some false negatives (#830) 85d424c
Fixes
v22.0.0
New rules
- Add
import-stylerule (#789) 0c7a199
Improvements
- Allow
Childreninno-fn-reference-in-iterator(#809) 036e440 filename-case: Ignore more index files (#826) 64d03a5- Update
ecmaVersionto2021(#820) a78cea3
Fixes
v21.0.0
New rules
- Add
prefer-array-findrule (#735) 12b46da - Add
no-object-as-default-parameterrule (#633) 9989d2d
Improvements
- Add
evtoeventdefault replacement toprevent-abbreviationsrule (#793) a0b4aba - Ignore more types in
no-fn-reference-in-iteratorandno-reducerule (#756) 5159c24 - Make
unicorn/prefer-flat-mapnot enabled by default in the recommended config 655220a - Improve
consistent-function-scopingreport location (#778) df218a2 - Improve
consistent-function-scopingmessage (#773) 4ed2adf
Fixes
v20.1.0
v20.0.0
Breaking
New rules
- Add
prefer-optional-catch-bindingrule (#671) efdb03a - Add
no-useless-undefinedrule (#718) 30dbe6d - Add
no-reducerule (#704) 06ed7ee
Improvements
throw-new-error: CheckMemberExpressioncustomError (#716) a28aad5prefer-starts-ends-with: Add auto-fix (#711) da978e3consistent-function-scoping: Ignore IIFE (#707) 1f4413dprefer-set-has: Ignore arrays only checking existence once (#706) 54c6f54