ESLint has a new configuration system where you programmatically compose your config using regular JS, and this can be done with type safety via TypeScript:
On line 13 the plugin has an invalid type, with this TypeScript error:
Type 'typeof import("[redacted]/node_modules/eslint-plugin-comment-length/lib/index")' is not assignable to type 'Plugin'.
Types of property 'configs' are incompatible.
Type '{ recommended: { plugins: string[]; rules: { "comment-length/limit-single-line-comments": string[]; "comment-length/limit-multi-line-comments": string[]; }; }; }' is not assignable to type 'Record<string, FlatConfig | FlatConfig[] | ConfigData<RulesRecord>>'.
Property 'recommended' is incompatible with index signature.
Type '{ plugins: string[]; rules: { "comment-length/limit-single-line-comments": string[]; "comment-length/limit-multi-line-comments": string[]; }; }' is not assignable to type 'FlatConfig | FlatConfig[] | ConfigData<RulesRecord>'.
Type '{ plugins: string[]; rules: { "comment-length/limit-single-line-comments": string[]; "comment-length/limit-multi-line-comments": string[]; }; }' is not assignable to type 'ConfigData<RulesRecord>'.
Types of property 'rules' are incompatible.
Type '{ "comment-length/limit-single-line-comments": string[]; "comment-length/limit-multi-line-comments": string[]; }' is not assignable to type 'Partial<RulesRecord>'.
Property '"comment-length/limit-single-line-comments"' is incompatible with index signature.
Type 'string[]' is not assignable to type 'RuleEntry<any[]> | undefined'.
Type 'string[]' is not assignable to type '[_: RuleLevel, ..._1: any[]]'.
Source provides no match for required element at position 0 in target.
ESLint has a new configuration system where you programmatically compose your config using regular JS, and this can be done with type safety via TypeScript:
https://eslint.org/docs/latest/use/configure/configuration-files-new#using-plugins-in-your-configuration
Unfortunately, this ESLint plugin doesn’t satisfy the type
import("eslint").ESLint.Plugin
.With this
eslint.config.js
module:On line 13 the plugin has an invalid type, with this TypeScript error: