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
const plugin: TSESLint.FlatConfig.Plugin = {
configs: {},
}
plugin.configs = {
recommended: [
{
plugins: {
example: plugin,
},
},
],
}
ESLint Config
No response
tsconfig
No response
Expected Result
The code should type check without errors. The code is a stripped down version of the example given on https://eslint.org/docs/latest/extend/plugins#configs-in-plugins except that I've replaced Object.assign
with a direct assignment because Object.assign
doesn't type check that it can be assigned.
You can see in that example that they set the recommended config to an array, but that's not allowed by the SharedConfigs
type used by TSESLint.FlatConfig.Plugin["configs"]
. If you replace TSESLint.FlatConfig.Plugin
with ESLint.Plugin
you can also see that it type checks without errors.
Actual Result
Type checking complains that an array can't be assigned to the type Config
(the type for the values of SharedConfigs
).
Additional Info
No response
Versions
package | version |
---|---|
@typescript-eslint/utils |
8.11.0 |
TypeScript |
5.6.3 |
ESLint |
9.13.0 |
node |
20.17.0 |