An opinionated ESLint config to encourage pure(ish), typeful functional programming in TypeScript.
MIT License
An opinionated ESLint config to encourage pure(ish), typeful functional programming in TypeScript.
yarn add --dev eslint-config-typed-fp \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser \
eslint \
eslint-plugin-functional \
eslint-plugin-total-functions \
typescript
.eslintrc.js
:module.exports = {
+ parser: "@typescript-eslint/parser",
parserOptions: {
+ project: "./tsconfig.json",
+ ecmaVersion: 2018,
+ sourceType: "module"
},
extends: [
+ "typed-fp",
...
],
plugins: [
+ "@typescript-eslint",
+ "functional",
+ "total-functions",
...
],
rules: {
...
}
};
Basically,
See the extends
and rules
sections in index.ts for the details.
Check out the TODOs in index.ts and of course the issues. Contributions welcome.
TypeScript (in)famously considers slavish adherance to type-safety and soundness (at least at the cost of developer ergonomics) a non-goal. With this ESLint config we take the opposite position.
Here's a selection of articles to motivate "why typed FP":