Closed as not planned
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Relevant Package
utils
Playground Link
No response
Repro Code
import { fixupPluginRules } from '@eslint/compat';
import react from 'eslint-plugin-react';
/** @type {import('@typescript-eslint/utils/ts-eslint').FlatConfig.ConfigArray} */
const configArray = [
{
plugins: {
react: fixupPluginRules(react), // 💥 Type 'FixupPluginDefinition' is not assignable to type 'Omit<Plugin, "configs">'.
// Types of property 'rules' are incompatible.
// Type 'Record<string, FixupRuleDefinition> | undefined' is not assignable to type 'Record<string, LooseRuleDefinition> | undefined'.
// Type 'Record<string, FixupRuleDefinition>' is not assignable to type 'Record<string, LooseRuleDefinition>'.
// 'string' index signatures are incompatible.
// Type 'FixupRuleDefinition' is not assignable to type 'LooseRuleDefinition'.ts(2322)
},
},
];
ESLint Config
See above
tsconfig
Expected Result
The types for SharedConfig.RuleEntry
match the return type for fixupPluginRules()
from @eslint/compat
Actual Result
The types do not match:
Type 'FixupPluginDefinition' is not assignable to type 'Omit<Plugin, "configs">'.
Types of property 'rules' are incompatible.
Type 'Record<string, FixupRuleDefinition> | undefined' is not assignable to type 'Record<string, LooseRuleDefinition> | undefined'.
Type 'Record<string, FixupRuleDefinition>' is not assignable to type 'Record<string, LooseRuleDefinition>'.
'string' index signatures are incompatible.
Type 'FixupRuleDefinition' is not assignable to type 'LooseRuleDefinition'.ts(2322)
Additional Info
No response
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
7.9.1-alpha.6 |
@typescript-eslint/parser |
7.9.1-alpha.6 |
@typescript-eslint/rule-tester |
7.9.1-alpha.6 |
@typescript-eslint/scope-manager |
7.9.1-alpha.6 |
@typescript-eslint/typescript-estree |
7.9.1-alpha.6 |
@typescript-eslint/type-utils |
7.9.1-alpha.6 |
@typescript-eslint/utils |
7.9.1-alpha.6 |
TypeScript |
5.4.5 |
ESLint |
9.3.0 |
node |
20.13.1 |
I also tried the latest v8 alpha (@typescript-eslint/eslint-plugin@8.0.0-alpha.13
), which should be compatible with ESLint v9, but this also results in the same error.