Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug: flat configuration block options are not independent #6778

Closed as not planned
Labels
bugSomething isn't workingworking as intendedIssues that are closed as they are working as intended
@JP-Ellis

Description

@JP-Ellis

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 havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Issue Description

First and foremost, this bug relates to the new ESLint flat configuration. I understand that this feature is still in beta and is now inPhase 3 which is to ensure compability with existing plugins. I suspect the error is with the TypeScript parser and not with ESLint.

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 oflanguageOptions 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:

  • When it is commented out, the*.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
  • When the TypeScript configuration block is uncommented, the*.ts files are correctly linted; however, the*.svelte files produce the following error relating totsconfig.ts:
      0:0  error  Parsing error: ESLint was configured to run on `<tsconfigRootDir>/src/routes/+page.svelte` using `parserOptions.project`: <tsconfigRootDir>/tsconfig.jsonHowever, that TSConfig does not include this file. Either:- Change ESLint's list of included files to not include this file- Change that TSConfig to include this file- Create a new TSConfig that includes this file and include it in your parserOptions.projectSee the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file
  • AddingextraFileExtensions: [".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

  1. clone the repo
  2. pnpm install
  3. pnpm lint (this should work fine)
  4. Uncomment the TypeScript configuration ineslint.config.js
  5. pnpm lint (this should produce errors)
  6. AddextraFileExtensions: [".svelte"] to thelanguageOptions in the TypeScript block.
  7. pnpm lint (this should have fixed the previous issue)

Versions

packageversion
@typescript-eslint/eslint-plugin5.56.0
@typescript-eslint/parser5.56.0
TypeScript5.0.2
ESLint8.36.0
node19.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingworking as intendedIssues that are closed as they are working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp