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

Docs: Typed Linting guide causes ESLint complaints in .eslintrc.(c)js #6826

Closed
Assignees
JoshuaKGoldberg
Labels
accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updating
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

When starting a TypeScript repository from scratch using our docs, the typical flow is:

  1. Getting Started
  2. Linting with Type Information

...however, we don't mention anything about how to get typed linting working (or excluded) for the.eslintrc.(c)js file we tell the user to write. As a result, the file receives this lovely complaint:

Parsing error: ESLint was configured to run on `<tsconfigRootDir>/.eslintrc.cjs` using `parserOptions.project`: /users/josh/repos/repros/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-fileeslint

Screenshot of the previous lint error in VS Code

That's a very wordy complaint for a first-time typed linting user to receive. Not ideal.

I'm not sure what the best way to resolve this is. A few starting options:

  • Useconfigoverrides to restrict type checking to.ts,.tsx,.cts, etc. files(I'm a little negative on this, as it makes the config more complex)
  • Tell them to exclude that ESLint config from being linted(I don't like this - many of us want to lint all our files)
  • Have the userallowJs in their TSConfig used for ESLint(I really don't like this - users will need to either add a new TSConfig for linting or modify their main project's compiler options)

...I don't love any of those 🤔. How are users "supposed" to fix this?

This issue came out of a Twitch stream with@Jutanium. 👋

Affected URL(s)

https://typescript-eslint.io/linting/typed-linting

Metadata

Metadata

Labels

accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updating

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