eslint-plugin-functional
eslint-plugin-functional copied to clipboard
ESLint rules to disable mutation and promote fp in JavaScript and TypeScript.
## Bug Report https://typescript.tv/errors/#ts1064 There's no way to type the return as Readonly
## Suggestion 👋 Coming over from https://github.com/eslint/eslint/issues/18093: ESLint is migrating to a [new "flat config" format](https://eslint.org/docs/latest/use/configure/configuration-files-new) that will be the default in ESLint v9. It doesn't look like `eslint-plugin-functional` has...
## Bug Report This errors with `ignoreImmediateMutation` set. ```ts Object.entries(foo).sort(...); ``` ### Expected behavior No error. ### Actual behavior Modifying an array is not allowed.
re #766
## Bug Report the `functional/immutable-data` rule with `ignoreImmediateMutation: true` will trigger an error when immediately mutating an array created with the string `.split()` method ### Expected behavior these rules ```...
## Bug Report Hi, me again with another recursion issue :P ```ts export type ReadonlyURLSearchParams = Readonly< OmitStrict >; // explosion here export const readonlyURLSearchParams = ( // eslint-disable-next-line functional/prefer-immutable-types...
## Bug Report no-mixed-types fails when a function type is aliased as part of a larger object type ### Expected behavior aliases are understood correctly ### Actual behavior functional/no-mixed-types fails...
## Suggestion So I think the idea of this rule is to treat everything immutable (by using `const` everywhere and avoiding typing everything as `Readonly`) and use `let` when explicitly...
## Bug Report ```ts type Thing = { a: string }; type OtherThing = { readonly a: string }; declare const a: readonly OtherThing[]; // Surprising. I would expect ReadonlyShallow,...
## Suggestion A new rule that forbids the partial versions of `reduce` and `reduceRight`. Given: ```typescript const arr: readonly string[] = ...; // may or may not be empty ```...