Skip to content

Bug: The name value is not propagated in the extended configs #10086

Closed
@TrevinAvery

Description

@TrevinAvery

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: typescript-eslintIssues related to the typescript-eslint package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions