-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
feat: enable @typescript-eslint/recommended in create-next-app --typescript #52845
feat: enable @typescript-eslint/recommended in create-next-app --typescript #52845
Conversation
d04e5aa
to
6c62e53
Compare
docs/02-app/01-building-your-application/06-configuring/02-eslint.mdx
Outdated
Show resolved
Hide resolved
docs/02-app/01-building-your-application/06-configuring/02-eslint.mdx
Outdated
Show resolved
Hide resolved
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
1 similar comment
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
916c007
to
aebad53
Compare
I'm going to rebase this branch to get rid of the merge commits. Makes it harder to review in this state. |
9375c2d
to
141b92d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this before its 1 year anniversary. Thank you for sticking with it @JoshuaKGoldberg 👍🏻
} | ||
``` | ||
|
||
Those rules are based on [`plugin:@typescript-eslint/recommended`](https://typescript-eslint.io/linting/configs#recommended). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoshuaKGoldberg It'd be also nice as a follow-up to document how one would opt-into type-aware ESLint rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! Strong +1.
Since typescript-eslint v8 with the stabilized projectService
is coming in a few months, my suggestion would be to procrastinate until then. That way we can use the nice:
{
"extends": ["next/core-web-vitals", "next/typescript",
+ "plugin:@typescript-eslint/recommended-type-checked" // (or similar)
],
+ "parserOptions": {
+ "projectService": true
+ }
}
Fixes #37151.
This differs a bit from the discussed approach for simplicity's sake now that typescript-eslint v6 is out. I started inline comments.This takes the approach suggested in the discussion of adding anext/typescript
linter preset.Also applies a small refactor to how the strict config is found from the prompt values. Instead of a
.find
, I extracted out the specific value into its own function.