You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm presented with the following boatload of a typescript error on line 6:
index.ts:6:5 - error TS2322: Type '{ configs: { recommended: { plugins: ["import-x"]; rules: { 'import-x/no-unresolved': "error"; 'import-x/named': "error"; 'import-x/namespace': "error"; 'import-x/default': "error"; 'import-x/export': "error"; 'import-x/no-named-as-default': "warn"; 'import-x/no-named-as-default-member': "warn"; 'import-x/no-duplica...' is not assignable to type 'Plugin'.
Types of property 'configs' are incompatible.
Type '{ recommended: { plugins: ["import-x"]; rules: { 'import-x/no-unresolved': "error"; 'import-x/named': "error"; 'import-x/namespace': "error"; 'import-x/default': "error"; 'import-x/export': "error"; 'import-x/no-named-as-default': "warn"; 'import-x/no-named-as-default-member': "warn"; 'import-x/no-duplicates': "warn...' is not assignable to type 'Record<string, LegacyConfig<RulesRecord, RulesRecord> | Config<RulesRecord> | Config<RulesRecord>[]>'.
Property ''stage-0'' is incompatible with index signature.
Type 'PluginConfig' is not assignable to type 'LegacyConfig<RulesRecord, RulesRecord> | Config<RulesRecord> | Config<RulesRecord>[]'.
Type '{ plugins?: ["import-x"] | undefined; settings?: { "import-x/cache"?: { lifetime?: number | "∞" | "Infinity" | undefined; } | undefined; "import-x/core-modules"?: string[] | undefined; ... 9 more ...; "import-x/resolver-next"?: NewResolver[] | undefined; } | undefined; rules?: Record<...> | undefined; } & Config' is not assignable to type 'LegacyConfig<RulesRecord, RulesRecord> | Config<RulesRecord> | Config<RulesRecord>[]'.
Type '{ plugins?: ["import-x"] | undefined; settings?: { "import-x/cache"?: { lifetime?: number | "∞" | "Infinity" | undefined; } | undefined; "import-x/core-modules"?: string[] | undefined; ... 9 more ...; "import-x/resolver-next"?: NewResolver[] | undefined; } | undefined; rules?: Record<...> | undefined; } & Config' is not assignable to type 'LegacyConfig<RulesRecord, RulesRecord>'.
Types of property 'overrides' are incompatible.
Type 'ConfigOverride[] | undefined' is not assignable to type 'ConfigOverride<RulesRecord>[] | undefined'.
Type 'ConfigOverride[]' is not assignable to type 'ConfigOverride<RulesRecord>[]'.
Type 'ConfigOverride' is not assignable to type 'ConfigOverride<RulesRecord>'.
Types of property 'parser' are incompatible.
Type 'string | null | undefined' is not assignable to type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.
Not sure how long this error is there, I'm still using eslintrc config, but am trying to finally migrate to flat.
The text was updated successfully, but these errors were encountered:
@silverwind So I have been looking into this. We have typed our rules with satisfies Record<string, TSESLint.RuleModule<string, readonly unknown[]>> (which is from typescript-eslint) which is conflicted with @types/eslint.
So I don't know what to do. if we make eslint-plugin-import-x compliant with @types/eslint, we will lose type information about the rule config. But if we stick with typescript-eslint, we can't use eslint-plugin-import-x with @types/eslint's types.
Hmm, sounds like a bug in either typescript-eslint or @types/eslint, tbh.
Nah. It just happens that they both maintain their own types and are not compatible with each other. We use the types from typescript-eslint because we also use utilities from them.
Given the following flat config (in a shared config):
I'm presented with the following boatload of a typescript error on line 6:
Not sure how long this error is there, I'm still using eslintrc config, but am trying to finally migrate to flat.
The text was updated successfully, but these errors were encountered: