fisker Cheung

Results 1279 comments of fisker Cheung

Good idea, but I'm not sure if we can do it right without type information, we should only report strings.

The `unicorn/prefer-array-some` is similar, the old `array.find()` maybe skipping falsely values, so it's fine to add this rule, just don't auto-fix.

> It makes sense, but what if map is specifically full of booleans? I feel I was wrong, it's common to store falsely values in a `Map`, especially `0`/`false`, and...

I'm not sure about this, it common pattern, and most time, it mean to used as method call, the problem is not how the object defined, but how it's used....

How about `no-method-destructuring`? Forbid destructure a method without `.bind()` ```js // Bad const foo = obj.foo; // Good const foo = obj.foo.bind(obj) // Good const foo = (...args) => obj.foo(...args)...

Sometime, we want index, but need check if it's `-1` before using it, example https://github.com/sindresorhus/eslint-plugin-unicorn/blob/5ba0f8379d06e581c614245200bdbd3d935822a7/rules/no-array-push-push.js#L40-L44

I've been using the following pattern to await a dialog to close/confirm ```js const {promise, resolve} = Promise.withResolvers(); Object.assign(fooDialog, {show: true, resolve}); await promise; ``` But turns out ```js await...

I think people used to see a ESLint plugin named with `eslint-plugin-` prefix, I prefer current name.

[eslint-unicorn](https://www.npmjs.com/package/eslint-unicorn) Weekly Downloads reached 17,298 ..

`new Set` take 0~1 arguments https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/Set#parameters