Closed
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
typescript-eslint
Playground Link
No response
Repro Code
No code needed. Just run eslint with the below config and it will error as expected.
ESLint Config
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
name: "TypeScript",
files: ['**/*.{ts,tsx}'],
extends: [
// intentional bug here, these items should use the spread oporator because they are arrays
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: __dirname, // use import.meta.dirname after updating to Node 20+
},
},
},
)
tsconfig
No response
Expected Result
When an error occurs with one of the configs, I expect the output to include the name
of the config, but when using extends
, the configs are all "unnamed".
Actual Result
In the example above I have added the name TypeScript
. But when it errors I see
ConfigError: Config (unnamed): Unexpected key "0" found.
Additional Info
The issue appears to be here. It only adds files
and ignores
to the extended objects. This should also included the name appended with an index. For example
...(config.name && { name: `${config.name}-${index}` }),
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
X.Y.Z |
@typescript-eslint/parser |
X.Y.Z |
@typescript-eslint/rule-tester |
X.Y.Z |
@typescript-eslint/scope-manager |
X.Y.Z |
@typescript-eslint/typescript-estree |
X.Y.Z |
@typescript-eslint/type-utils |
X.Y.Z |
@typescript-eslint/utils |
X.Y.Z |
TypeScript |
X.Y.Z |
ESLint |
X.Y.Z |
node |
X.Y.Z |