Bug: flat configuration block options are not independent #6778
Labels
bug
Something isn't working
working as intended
Issues that are closed as they are working as intended
Before You File a Bug Report Please Confirm You Have Done The Following...
Issue Description
Expected Behaviour
I should be able to configure options for the TypeScript parser independently when it is used within the TypeScript section of the config, and the Svelte section of the configuration.
Actual Behaviour
The setting of
languageOptions
in the block of the ESLint config targetting**/*.ts
files has side-effects, impacting the use of the TypeScript parser in the Svelte section targettin**/*.svelte
files.In the example repo (below), the ESLint config contains the following segment:
https://github.com/JP-Ellis/eslint-plugin-svelte-mwe/blob/f09107de3dcb59704a4e6d416b26eaa720f25c10/eslint.config.js#L20-L36
I note the following behaviours:
*.svelte
files are parsed and linted correctly. The TypeScript files are not linted, which is expected as non of the configuration blocks in ESLint match*.ts
files*.ts
files are correctly linted; however, the*.svelte
files produce the following error relating totsconfig.ts
:extraFileExtensions: [".svelte"]
to thelanguageOptions
in the TypeScript block (and having it uncommented) resolves the above issue.My expectation is that the settings passed in the TypeScript config block should be independent of the settings passed in the Svelte block.
Reproduction Repository Link
https://github.com/JP-Ellis/eslint-plugin-svelte-mwe
Repro Steps
pnpm install
pnpm lint
(this should work fine)eslint.config.js
pnpm lint
(this should produce errors)extraFileExtensions: [".svelte"]
to thelanguageOptions
in the TypeScript block.pnpm lint
(this should have fixed the previous issue)Versions
@typescript-eslint/eslint-plugin
5.56.0
@typescript-eslint/parser
5.56.0
TypeScript
5.0.2
ESLint
8.36.0
node
19.8.1
The text was updated successfully, but these errors were encountered: