eslint-plugin-array-func
eslint-plugin-array-func copied to clipboard
Rules for Array functions and methods.
with latest version of eslint plus your plugin, I can't fix code. If I do a `yarn eslint --fix file.ts` it shows me errors and even suggests to me to...
A rule can now suggest fixes, instead of providing one absolutely correct fix.
```javascript // invalid: arr .filter(x => p(x)) .find(x => q(x)) // valid arr .find(x => p(x) && q(x)) // Outputs are equivalent (I think). Also potentially short-circuits faster. ``` The...
Array.from etc. are probably slower. Need to investigate.
- `indexOf`/`lastIndexOf` with a literal param - `slice`/`splice` with literal params - `map`, `filter`, `sort` and `reduce` without references to something in the outer scope or some global like Date.now()...
Yeah, let's avoid doing the proposed solution in https://itnext.io/heres-why-mapping-a-constructed-array-doesn-t-work-in-javascript-f1195138615a and use filling instead.
Ensure methods are called on arrays, though that may be quite complicated, especially with method return values. Maybe change the certainness? Such a change should also add an option to...
## Description Check for the methods `from`, `every`, `filter`, `find`, `findIndex`, `forEach`, `map` and `some` that the parameter doesn't have a `.bind(foo)` (and prefer the use of the parameter `thisArg`)....
Version: 3.1.8 ESLint: 8.31.0 Node.js: 19.3.0 For the following code: ```ts export const uniqueMappingPaths = ( mappingPaths: RA ): RA => Array.from( new Set(filterArray(mappingPaths).map(mappingPathToString)), splitJoinedMappingPath ).map((path) => (path.length === 1...
In flat config format, eslint plugins are imported using `import` statements should therefor publish type definitions to avoid such typescript errors: ``` TS7016: Could not find a declaration file for...