fisker Cheung

Results 335 issues of fisker Cheung

We are going to add `prefer-object-from-entries` rule in #1308. As proposed in [the original proposal](https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1260), the following case should be reported too ```js const foo = {}; for (const [key,...

#1812 makes me realize that the following edge cases will cause runtime error by autofix. ```js // The second parameter default value can be a reference from first parameter array.forEach((element,...

bug
help wanted

## Fail ```js const array = [ ...foo.map(/* ... */) ]; ``` Other array methods returns a new array, eg: `concat()`, `flatMap()`, `copyWithin()`, etc Other known arrays, eg: `Array.from()`, `Object.keys()`,...

enhancement

### Description More clear intention, prevent mistake like this ```text bar = '12345'; '0'.repeat(4 - bar.length) + bar; VM433:2 Uncaught RangeError: Invalid count value at String.repeat () bar = '12345';...

help wanted
new rule

### Description https://github.com/eslint/eslint/pull/15731#issuecomment-1082586113 ### Fail ```js Array.from({length: 10 + 1}).join('*') ``` ```js Array.from({length: 10}).fill('*').join('') ``` ```js Array.from({length: 10}, () => '*').join('') ``` ### Pass ```js '*'.repeat(10) ``` ```js String(foo).repeat(10) ```

help wanted
new rule

When throwing a new error in `try/catch` or `Promise#catch`, should add the old error as new error's cause property. - ["Error Cause" proposal](https://github.com/tc39/proposal-error-cause) ## Fail ```js try {} catch {...

help wanted
new rule

### Description There are legacy ways to repeat string, we should replace them with `.repeat()`, but this proposal is not about that. I want enforce `.repeat()` for unreadable repeating string...

help wanted
new rule

["Change Array by copy" proposal](https://github.com/tc39/proposal-change-array-by-copy#change-array-by-copy) ## Fail ```js array.reverse(); ``` ```js array.sort(); ``` ```js const array = [...foo]; array.splice(0, 1); ``` ```js const array = [...foo]; array[1] = 'changed'; ```...

help wanted
new rule

Rename `no-array-for-each` to `no-for-each`. It's actually check other types, `Set` (Buggy #1452), `Map`, `NodeList` etc

enhancement
docs

### Description When a function accepts a single or multiple things. Though `[foo].flat()` is shorter and nicer, but it's not very clear to me. I prefer `Array.isArray(foo) ? foo :...

help wanted
new rule