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

Enhancement: Better error message if parserOptions.project is set to an invalid TSConfig #10511

Open
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or request
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

typescript-estree

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

It's not unheard of for folks to setparserOptions.project to a different config file than a TSConfig. For example, someone could easily accidentally do:

parserOptions:{project:'eslint.config.js',}

...at which point their config would give a lovely spew like:

/Users/josh/repos/repros/index.ts  0:0  error  Parsing error: eslint.config.js(1,1): error TS1327: String literal with double quotes expected.eslint.config.js(1,8): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.eslint.config.js(1,15): error TS1136: Property assignment expected.eslint.config.js(1,32): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.eslint.config.js(2,1): error TS1327: String literal with double quotes expected.eslint.config.js(2,8): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.eslint.config.js(2,17): error TS1136: Property assignment expected.eslint.config.js(2,41): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.eslint.config.js(4,1): error TS1327: String literal with double quotes expected.eslint.config.js(4,7): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.eslint.config.js(4,8): error TS1327: String literal with double quotes expected.eslint.config.js(4,16): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal

Yuck.

Proposal: ifparserOptions.project is set to something that's not a valid TSConfig, how about the tooling give a specialized error message?

Vaguely:

/Users/josh/repos/repros/index.ts  0:0  error  Parsing error: Unable to load parserOptions.project: "eslint.config.js" as a TSConfig. Is this a valid JSON(C) TSConfig file?See https://typescript-eslint.io/getting-started/typed-linting for information on typed linting.

Additional Info

Ideated out of this Discord thread:https://discord.com/channels/1026804805894672454/1317907420403732571

💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or request

    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