Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linter): expose rule name when eslint requires parser options project #20459

Conversation

AgentEnder
Copy link
Member

Current Behavior

We map the thrown eslint error message to add in extra context, but lose the name of the rule causing the error to be thrown, resulting in a message like:

Error: You have attempted to use a lint rule which requires the full TypeScript type-checker to be available, but you do not have parserOptions.project configured to point at your project tsconfig.json files in the relevant TypeScript file "overrides" block of your project ESLint config packages/nx/.eslintrc.json

Please see https://nx.dev/guides/eslint for full guidance on how to resolve this issue.

Expected Behavior

The thrown error originally mentioned the failing rule, so we keep that context info. e.g.:

Error: You have attempted to use the lint rule @typescript-eslint/no-floating-promises which requires the full TypeScript type-checker to be available, but you do not have parserOptions.project configured to point at your project tsconfig.json files in the relevant TypeScript file "overrides" block of your project ESLint config packages/nx/.eslintrc.json

Please see https://nx.dev/guides/eslint for full guidance on how to resolve this issue.

Related Issue(s)

Fixes #

@AgentEnder AgentEnder requested a review from a team as a code owner November 28, 2023 18:22
Copy link

vercel bot commented Nov 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Dec 1, 2023 10:05am

@AgentEnder AgentEnder force-pushed the fix/expose-rulename-when-typechecker-expected branch from 432aa0a to 7eb0b83 Compare November 30, 2023 20:53
@meeroslav meeroslav enabled auto-merge (squash) December 1, 2023 10:00
@meeroslav meeroslav merged commit 9e322e8 into nrwl:master Dec 1, 2023
6 checks passed
Copy link

github-actions bot commented Dec 7, 2023

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants