danielnixon / eslint-plugin-total-functions

An ESLint plugin to enforce the use of total functions (and prevent the use of partial functions) in TypeScript.
MIT License
88 stars 4 forks source link

New rule: io-ts codec restrictions #334

Open danielnixon opened 3 years ago

danielnixon commented 3 years ago
danielnixon commented 3 years ago

You could probably fix t.type to t.readonly(t.type(...)) too.

danielnixon commented 1 year ago

Similarly, we likely want to enforce t.exact / t.strict to avoid issues related to unsafe decoding, smuggling extra props, etc.

adamlthomas commented 1 year ago
danielnixon commented 1 year ago

If we widen the scope of this to fp-ts generally, another useful rule might be forbidding lib imports.

Good:

import { flow } from 'fp-ts/function'

Bad:

import { flow } from 'fp-ts/lib/function'
danielnixon commented 1 year ago

Oh look, that already exists https://github.com/buildo/eslint-plugin-fp-ts/blob/main/docs/rules/no-lib-imports.md