⬆️ Updates eslint-plugin-unicorn to v51 #724
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^33.0.1
->^51.0.0
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
sindresorhus/eslint-plugin-unicorn (eslint-plugin-unicorn)
v51.0.1
Compare Source
prefer-node-protocol
: Fix false positive onbun:*
modules (#2272)43fc638
v51.0.0
Compare Source
Breaking
consistent-destructuring
: Remove fromrecommended
preset (#2260)702d51b
Improvements
no-array-method-this-argument
: CheckArray.from()
(#2262)797caee
Fixes
no-thenable
: Fix crash on{[Symbol.prototype]: 0}
(#2248)3c7d7c0
prefer-prototype-methods
: Fix argument ofisMethodCall
(#2247)3b504fa
v50.0.1
Compare Source
Fixes
no-unnecessary-polyfills
: Fix missing dependency error (#2242)3df1606
v50.0.0
Compare Source
New rules
no-unnecessary-polyfills
(#1717)6788d86
Improvements
65711f9
no-useless-undefined
: AddcheckArrowFunctionBody
option (#2232)9d7048c
prefer-negative-index
: CheckTypedArray#subarray()
(#2237)6708a30
no-useless-undefined
: Ignore React state setters (#2223)42881ba
prefer-module
: Allowmodule
as TSTypeParameter name (#2213)8f61f7c
Fixes
string-content
: Fix JSX autofix for newlines, etc. (#2222)b95e75e
v49.0.0
Compare Source
Improvements
expiring-todo-comments
: Support monorepos (#2159)ac51d40
prefer-module
: Allowmodule
as TSIndexSignature names or TSTypeAliasDeclaration ids (#2209)ea94b3b
v
flag (#2195)28e7498
prefer-event-target
: IgnoreEventEmitter
from@angular/core
andeventemitter3
(#2197)1629ebe
v48.0.1
Compare Source
no-empty-file
: Fix directive check for TypeScript parser (#2180)1bb9ce8
v48.0.0
Compare Source
Improvements
no-unsafe-regex
rule (#2135)7b473aa
prefer-top-level-await
: Ignore promises insidePromise.{all,allSettled,any,race}()
(#2139)d3f6b60
no-process-exit
: Ignore when usingnode:worker_threads
module (#2136)2907805
prefer-array-some
: Ignore filter calls with literal argument (#2097)7a32edb
prefer-modern-math-api
: Check cases thatMath.hypot()
should be preferred (#2080)9bbc948
explicit-length-check
: Ignore.length || number
(#1977)b9b8794
Fixes
f10f1a6
prefer-dom-node-dataset
: Fix edge cases (#2171)b2d7378
prefer-dom-node-dataset
: Remove broken fix forelement.setAttribute
(#2169)61234af
no-lonely-if
: Fix an edge case (#2168)ca837a8
no-useless-undefined
: Turn parameter withundefined
default value into optional parameter (#2138)4aa7d60
no-thenable
: FixObject.fromEntries()
check (#2130)f3265b9
prefer-dom-node-remove
: Fix incorrect auto-fix (#2084)74bb36d
v47.0.0
Compare Source
Breaking
a3bc120
eslint@>=8.38.0
(#2066)04af765
prefer-at
,prefer-event-target
, andprefer-string-replace-all
in recommended config (#2073)a3bc120
New rules
prefer-blob-reading-methods
(#2065)2bb1a04
Improvements
prefer-top-level-await
: Ignore.cjs
files (#2072)0c3ccb1
prefer-spread
: Stop checkingArray.from
call with map function (#2064)f5beccb
prefer-dom-node-text-content
: Check optional chaining (#2062)8d6d007
prefer-dom-node-{append,remove}
: Check optional chaining (#2061)443999b
Fixes
prefer-number-properties
: Fix false positives (#2050)124bfa7
v46.0.1
Compare Source
expiring-todo-comments
(#2077)7a6861a
v46.0.0
Compare Source
Improvements
elems
to abbreviations (#2040)2a9c840
no-useless-spread
: CheckArray#{toReversed,toSorted,toSpliced,with}
(#2030)55469e5
prefer-set-has
: SupportArray#{toReversed,toSorted,toSpliced,with}
(#2032)fea5b42
prefer-spread
: Forbid use ofArray#toSpliced()
to copy array (#2034)4ada50e
prefer-negative-index
: Check.toSpliced()
and.with()
(#2031)7ed738a
no-empty-file
: Support.jsx
and.tsx
extensions (#2002)ba1a00e
Fixes
expiring-todo-comments
: Do not normalize package.json (#1871) (#2020)fcd8934
v45.0.2
Compare Source
prefer-string-replace-all
: Don't crash on invalid pattern (#2011)3bbe027
prevent-abbreviations
: Skip fix for variables used in Vue template (#2012)8cd1ded
v45.0.1
Compare Source
no-useless-spread
: Remove unsafe fix (#1996)6756cbd
v45.0.0
Compare Source
New rules
no-typeof-undefined
(#1966)d7f7341
no-negated-condition
(#1963)e4aaa42
prefer-set-size
(#1952)5f23c98
Improvements
prefer-at
: Support private fields (#1929)60bb455
no-useless-undefined
: IgnoreArray#includes()
andSet#has()
(#1951)8dfd5a7
no-useless-spread
: Check cloning inline arrays (#1980)5d90d73
prefer-top-level-await
: Ignore expressions in class (#1976)b90a3aa
prefer-string-replace-all
: Improve RegExp to string fix (#1971)b844dbc
prefer-string-replace-all
: Check pattern even if it's already using.replaceAll
(#1981)e8c5156
prefer-string-replace-all
: Report allString#replace()
when the pattern hasg
flag (#1965)6316f05
prefer-string-replace-all
: Ignore regex with pipe (#1962)76deaa3
prefer-regexp-test
: Use suggestions if not sure regexp withoutg
flag (#1954)505a203
no-array-for-each
: Skip fix for some edge cases (#1979)48efc7a
prefer-add-event-listener
: Only fixExpressionStatement
, checkoperator
(#1955)aca21f2
prevent-abbreviations
: Improve fix forretVal
(#1953)25cd810
Fixes
prefer-top-level-await
: Fix crash onfor..of
loop (#1950)00a29c8
v44.0.2
Compare Source
no-array-method-this-argument
: Ignorelodash.findLast
andlodash.findLastIndex
(#1927)86e8add
v44.0.1
Compare Source
prefer-array-index-of
: Add missing message (#1924)a981a13
v44.0.0
Compare Source
New rules
no-unnecessary-await
(#1904)412fc6f
switch-case-braces
(#1902)690ed8c
Improvements
prefer-array-find
: Add option to also prefer.findLast()
(#1900)02252c7
template-indent
: Preserve trailing spaces (#1872)e4071f5
no-document-cookie
: Checkwindow.document.cookie
(#1833)0886544
prefer-array-index-of
: Prefer.lastIndexOf()
over.findLastIndex()
(#1896)70e5bdd
prefer-array-some
: Check.findLast()
(#1897)3e6ae43
prefer-native-coercion-functions
: Check.findLast
and.findLastIndex
(#1893)f2c6acc
no-array-method-this-argument
: Check.findLast
and.findLastIndex
(#1890)3bc28ad
no-array-callback-reference
: Check.findLast
and.findLastIndex
(#1889)37a5cda
prefer-negative-index
: RemoveArrayBuffer#at
(#1899)a10e3f6
prefer-at
: Improve fix (#1901)1c457bb
Fixes
no-await-expression-member
: Fix crash on TypeScript parser (#1910)b002e75
prevent-abbreviations
: Skip fix when variable is JSX component (#1907)9ed08ab
better-regexp
: Don't fix if.source
or.toString()
is used (#1903)8ad592b
v43.0.2
Compare Source
prefer-spread
: IgnoreArray#join().concat()
and(a + b).concat()
(#1859)ab71971
v43.0.1
Compare Source
prefer-event-target
from the recommended preset4d2faac
EventTarget
requires Node.js 16 and we target Node.js 14. We'll enable it again in a year when we can target Node.js 16.v43.0.0
Compare Source
New rules
prefer-logical-operator-over-ternary
(#1830)5d7e622
prefer-event-target
(#1792)166524a
Breaking
Improvements
prefer-top-level-await
rule to recommended preset (#1803)6f5ecf5
import-index
rule (#1787)0034e69
4b96057
text-encoding-identifier-case
: Ignore JSXmeta[charset="utf-8"]
(#1817)c67a70f
prefer-number-properties
: Check any use of global functions (#1834)51d7e06
prefer-number-properties
: Detect usage via global object (#1832)80c4af2
no-array-for-each
: Check reassign infor..in
andfor..of
(#1824)d3b2548
no-useless-undefined
: Ignoreref(undefined)
in Vue project (#1828)e7306e5
prefer-node-protocol
: Always checkrequire()
(#1827)2c914d4
no-array-for-each
: Improve parameter reassign detection (#1823)56df468
no-array-for-each
: Add fix for arrow function body (#1785)59218e3
Fixes
no-array-for-each
: Fix auto-fix causing SyntaxError (#1813)47c8337
v42.0.0
Compare Source
The project has passed 100 lint rules 🎉
Thanks to everyone that has contributed so far.
And special thanks to our team member @fisker for doing most of the work on this project. We could not have gotten this far without him.
New rules
no-useless-switch-case
(#1779)a8fb966
prefer-modern-math-apis
(#1780)6dfdeb0
no-unreadable-iife
(#1765)ce8a4b7
prefer-native-coercion-functions
(#1767)51166f4
Improvements
template-indent
: Set the ruleerror
instead ofwarn
inrecommended
preset (#1781)09923af
prefer-json-parse-buffer
: Remove fromrecommended
preset (#1750)93f49f2
no-array-for-each
: Add fixer for parenthesized call (#1784)5f39c37
no-array-for-each
: Handle optional chaining (#1753)1d32db4
prefer-object-from-entries
: Stop checking unknown cases (#1771)309771d
prefer-string-trim-start-end
: Check optional chaining (#1768)1920597
no-useless-undefined
: Ignore arguments inFunction#bind()
(#1762)c501243
prefer-ternary
: Skip fix if there are comments (#1763)3013565
text-encoding-identifier-case
: Auto-fix encoding infs.{readFile,readFileSync}()
(#1755)5e1c932
dist
anddst
abbreviations (#1756)dffcea8
Fixes
no-array-for-each
: HandleChainExpression
correctly (#1772)e615a37
v41.0.1
Compare Source
relative-url-style
: Improve fix (#1748)f406795
v41.0.0
Compare Source
New rules
text-encoding-identifier-case
(#1718)4370602
Breaking
608a90c
Fixes
prefer-export-from
: Fix TypeScript compatibility (#1728)f14aa95
prefer-at
: Remove auto-fix forarguments
(#1705)bba518e
v40.1.0
Compare Source
expiring-todo-comments
: Adddate
option (#1683)16bc33a
consistent-function-scoping
: AllowReact.useHook
(#1691)e910633
no-useless-undefined
: AllowReact.createContext(undefined)
(#1688)40bc603
v40.0.0
Compare Source
New rules
no-thenable
(#1616)c318644
no-useless-promise-resolve-reject
(#1623)054436e
relative-url-style
(#1672)6ab705b
prefer-json-parse-buffer
(#1676)84c9c70
Improvements
prefer-object-has-own
: Deprecate in favor of the built-inprefer-object-has-own
rule (#1646)e59a856
filename-case
: Ignore$
in filenames (#1628)a43a174
no-useless-promise-resolve-reject
: Detect unnecessaryPromise.resolve
/reject
in promise callback functions (#1666)f6215f3
prefer-export-from
: Support import assertions (#1618)1d7a6b6
prefer-top-level-await
: Improve top-level expression detection (#1526)b054d65
prefer-dom-node-dataset
: Check.hasAttribute()
and.getAttribute()
(#1673)152f153
prefer-dom-node-dataset
: Check.removeAttribute()
(#1668)22d8d03
prefer-string-slice
: Improve fix (#1675)267115a
prefer-math-trunc
: Improve fix logic (#1670)784c7a8
prefer-string-slice
: Improve argument type detection (#1664)03b0946
prefer-add-event-listener
: Remove fix foronerror
(#1650)7bf63bb
no-array-push-push
: Ignoreprocess.{stdin,stdout,stderr}
(#1654)10ad699
no-new-array
&no-new-buffer
: Improve argument type detection (#1648)9b04e43
no-array-for-each
: IgnorepIteration.forEach
(#1649)2b92385
no-array-callback-reference
: Ignore primitive wrappers inArray#map()
(#1642)0362c09
prefer-export-from
: Support "string literal specifier" (#1636)0866b41
template-indent
: Check Jest inline snapshots by default (#1637)64460e2
Fixes
prefer-dom-node-dataset
: Fix name conversion (#1674)7fb6f7b
prefer-export-from
: Fix crash in TypeScript files (#1647)1ff8e42
v39.0.0
Compare Source
New rules
prefer-code-point
(#1584)31c83cd
no-await-expression-member
(#1586)0485924
Improvements
prefer-export-from
: AddignoreUsedVariables
option (#1590)a8d52e4
prevent-abbreviations
: Show file basename instead of full path (#1593)7c2867d
require-post-message-target-origin
rule from recommended config (#1581)014b4dc
Fixes
no-empty-file
: Fix false positive with triple-slash directives (#1605)6354bb8
require-number-to-fixed-digits-argument
: Ignore.toFixed
from new expression (#1601)20d61e7
prefer-export-from
: Fix bug on fixing export namespace as default (#1583)b564ff1
additionalProperties
to schema (#1589)579d05d
v38.0.1
Compare Source
prefer-export-from
: Ignore variables with type (#1580)ea49b21
v38.0.0
Compare Source
New rules
no-empty-file
(#1506)a2ba25e
prefer-export-from
(#1453)ff43745
Improvements
5f3bad5
no-array-callback-reference
: Only ignoreBoolean
in reasonable places (#1570)46f8638
require-array-join-separator
: Check optional member (#1569)15f9028
v37.0.1
Compare Source
e6cee0f
v37.0.0
Compare Source
New rules
template-indent
(#1478)5f4c440
Improvements
e97ab7e
'latest'
asecmaVersion
(#1465)9feb181
v36.0.0
Compare Source
New rules
no-useless-fallback-in-spread
(#1481)1675118
no-invalid-remove-event-listener
(#1216)f0ff04d
Improvements
all
config (#1512)a512ad1
prefer-spread
: CheckString#split('')
(#1489)d51a197
prefer-module
: Use suggestions for'use strict'
directive (#1470)57c7906
error-message
: Handle shadowedError
constructor (#1496)fdadd88
Fixes
prefer-spread
: Fix false negative on array constants (#1474)4162145
v35.0.0
Compare Source
New rules
prefer-object-from-entries
(#1308)4a14187
no-useless-length-check
(#1398)1107455
no-useless-spread
(#1401)1463f52
Breaking
explicit-length-check
: Removegreater-than-or-equal
option (#1397)db1a2b5
Improvements
no-array-reduce
: AddallowSimpleOperations
option (#1418)153eb2c
no-array-callback-reference
: Ignore jQuery methods (#1457)7af9a6f
prevent-abbreviations
: Ignorei18n
andl10n
(#1445)efdd90e
no-array-callback-reference
: Ignore mobx-state-tree usage (#1455)73c0dfd
new-for-builtins
: CheckWeakRef
andFinalizationRegistry
(#1450)fce9d1d
no-zero-fractions
: Handle.0
correctly (#1444)fcca35d
new-for-builtins
: Enforcenew
forSharedArrayBuffer
andProxy
(#1438)2ba83ad
no-null
: AllowObject.create(null, …)
(#1432)768f301
number-literal-case
: Support Vue SFC (#1434)ee9f609
no-object-as-default-parameter
: Forbid destructuring (#1433)3fcc4bb
prefer-spread
: Better auto-fix (#1426)7bdf0dd
prefer-array-some
: Check cases comparing.find()
withundefined
(#1422)3dc2f77
no-useless-spread
: Check useless "iterable to array" (#1414)61bc6a3
prefer-dom-node-text-content
: Check destructuring, Use suggestion instead of auto-fix (#1417)c4bfc42
require-post-message-target-origin
: Disable for TypeScript files (#1415)741484a
prefer-add-event-listener
: Update event types list (#1412)7f88b2f
no-instanceof-array
: Support Vue SFC (#1410)3b22917
prevent-abbreviations
: Adddef
(#1402)f783472
no-instanceof-array
: Improve report location (#1389)6512fbd
bb81582
Fixes
throw-new-error
: Fix an edge case (#1390)806831b
179b7df
v34.0.1
Compare Source
no-array-method-this-argument
: Fix false positives (#1386)d364d67
v34.0.0
Compare Source
New rules
no-array-method-this-argument
(#1357)96587f2
require-post-message-target-origin
(#1326)03c540b
prefer-top-level-await
(#1325)05722a1
prefer-at
(#1331)8ca5b46
Improvements
prefer-module
: Ignore.cjs
files (#1355)ebdc3c2
Configuration
📅 Schedule: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" in timezone Europe/Moscow, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.