# Install with npm
npm install -D eslint eslint-plugin-functional
# Install with yarn
yarn add -D eslint eslint-plugin-functional
# Install with pnpm
pnpm add -D eslint eslint-plugin-functional
# Install with npm
npm install -D eslint typescript-eslint eslint-plugin-functional
# Install with yarn
yarn add -D eslint typescript-eslint eslint-plugin-functional
# Install with pnpm
pnpm add -D eslint typescript-eslint eslint-plugin-functional
In your eslint.config.js
file, import typescript-eslint
and eslint-plugin-functional
and configure them as you wish.
// eslint.config.js
import functional from "eslint-plugin-functional";
import tseslint from "typescript-eslint";
export default tseslint.config({
files: ["**/*.ts"],
extends: [
functional.configs.externalTypeScriptRecommended,
functional.configs.recommended,
functional.configs.stylistic,
// your other plugin configs here
],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
},
},
rules: {
// any rule configs here
},
});
In your eslint.config.js
file, import eslint-plugin-functional
and configure it as you wish.
If you're not using TypeScript, be sure to include the disableTypeChecked
config after the other configs to
disable rules that require TypeScript.
// eslint.config.js
import functional from "eslint-plugin-functional";
export default [
functional.configs.externalVanillaRecommended,
functional.configs.recommended,
functional.configs.stylistic,
functional.configs.disableTypeChecked,
// your other plugin configs here
{
rules: {
// any rule configs here
},
},
];