From af30f15f2ece3012b6b4f4826686cffcd6039a8c Mon Sep 17 00:00:00 2001 From: Rebecca Stevens Date: Mon, 11 Mar 2024 12:36:23 +1300 Subject: [PATCH] feat: new config to disable all rules that require type info --- src/configs/disable-type-checked.ts | 13 +++++++++++++ src/index.ts | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 src/configs/disable-type-checked.ts diff --git a/src/configs/disable-type-checked.ts b/src/configs/disable-type-checked.ts new file mode 100644 index 000000000..76b7fdc5e --- /dev/null +++ b/src/configs/disable-type-checked.ts @@ -0,0 +1,13 @@ +import { type Linter } from "@typescript-eslint/utils/ts-eslint"; + +import { rules } from "#eslint-plugin-functional/rules"; + +const config: Linter.Config = { + rules: Object.fromEntries( + Object.entries(rules) + .filter(([, rule]) => rule.meta.docs?.requiresTypeChecking === true) + .map(([name]) => [`functional/${name}`, "off"]), + ), +}; + +export default config; diff --git a/src/index.ts b/src/index.ts index 5879885be..d98257d8a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import { type Linter } from "@typescript-eslint/utils/ts-eslint"; import all from "#eslint-plugin-functional/configs/all"; import currying from "#eslint-plugin-functional/configs/currying"; +import disableTypeChecked from "#eslint-plugin-functional/configs/disable-type-checked"; import externalTypeScriptRecommended from "#eslint-plugin-functional/configs/external-typescript-recommended"; import externalVanillaRecommended from "#eslint-plugin-functional/configs/external-vanilla-recommended"; import lite from "#eslint-plugin-functional/configs/lite"; @@ -23,6 +24,7 @@ const config: Linter.Plugin = { recommended, strict, off, + "disable-type-checked": disableTypeChecked, "external-vanilla-recommended": externalVanillaRecommended, "external-typescript-recommended": externalTypeScriptRecommended, currying,