ITADN

Support `defineConfig` of ESLint, instead of `tseslint.config`

#998Closedldrick 创建于 2025-10-08
Type: EnhancementAcceptedStatus: Released
L
ldrickcommented
## Suggestion See `tseslint.config()` is deprecated: https://typescript-eslint.io/packages/typescript-eslint/#config-deprecated It is recommended to setup plugins with `defineConfig` of `eslint`. Trying to setup this plugin the recommended way results in: > Type 'EslintPluginFunctional' is not assignable to type 'Plugin'. > Types of property 'configs' are incompatible. > Type 'SharedConfigs & Readonly<{ all: Config; lite: Config; recommended: Config; strict: Config; off: Config; disableTypeChecked: Config; ... 7 more ...; stylistic: Config; }>' is not assignable to type 'Record<string, ConfigObject<RulesConfig> | LegacyConfigObject<RulesConfig, RulesConfig> | ConfigObject<RulesConfig>[]> | undefined'.ts(2322) What I did (extraction from `eslint.config.js`): ```javascript // @ts-check import functionalPlugin from 'eslint-plugin-functional'; import { defineConfig } from 'eslint/config'; import typescriptEslint from 'typescript-eslint'; export default defineConfig( // register all of the plugins upfront { plugins: { ['@typescript-eslint']: typescriptEslint.plugin, // @ts-expect-error not compatible to use defineConfig ['functional']: functionalPlugin, }, }, // many more configuration ... ); ```
关闭于 2026-02-23 1 条评论