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

feat: enable @typescript-eslint/recommended in create-next-app --typescript #52845

Merged

Conversation

JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Jul 18, 2023

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 a next/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.

@ijjk ijjk added create-next-app Related to our CLI tool for quickly starting a new Next.js application. area: documentation examples Issue/PR related to examples type: next labels Jul 18, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the title feat: enable @typescript-eslint/recommended internally and -type-chec… feat: enable @typescript-eslint/recommended and stylistic in create-next-app --typescript Jul 20, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the title feat: enable @typescript-eslint/recommended and stylistic in create-next-app --typescript feat: enable @typescript-eslint/recommended in create-next-app --typescript Jul 20, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the title feat: enable @typescript-eslint/recommended in create-next-app --typescript feat: enable @typescript-eslint/recommended-type-checked in create-next-app --typescript Jul 20, 2023
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the enable-typescript-eslint-recommended branch from d04e5aa to 6c62e53 Compare July 20, 2023 15:39
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review July 20, 2023 15:47
@ijjk
Copy link
Member

ijjk commented Jul 27, 2023

Allow CI Workflow Run

  • approve CI run for commit: b2a3ac6

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

1 similar comment
@ijjk
Copy link
Member

ijjk commented Jul 27, 2023

Allow CI Workflow Run

  • approve CI run for commit: b2a3ac6

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ijjk
Copy link
Member

ijjk commented Jul 27, 2023

Allow CI Workflow Run

  • approve CI run for commit: b078370

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@styfle styfle added the CI approved Approve running CI for fork label Jul 28, 2023
@eps1lon eps1lon force-pushed the enable-typescript-eslint-recommended branch from 916c007 to aebad53 Compare June 25, 2024 14:22
@eps1lon
Copy link
Member

eps1lon commented Jun 26, 2024

I'm going to rebase this branch to get rid of the merge commits. Makes it harder to review in this state.

@eps1lon eps1lon force-pushed the enable-typescript-eslint-recommended branch from 9375c2d to 141b92d Compare June 26, 2024 16:58
Copy link
Member

@eps1lon eps1lon left a 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 👍🏻

@eps1lon eps1lon enabled auto-merge (squash) June 26, 2024 18:57
}
```

Those rules are based on [`plugin:@typescript-eslint/recommended`](https://typescript-eslint.io/linting/configs#recommended).
Copy link
Member

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.

Copy link
Contributor Author

@JoshuaKGoldberg JoshuaKGoldberg Jun 26, 2024

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
+ }
}

@eps1lon eps1lon merged commit 72a6408 into vercel:canary Jun 27, 2024
82 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the enable-typescript-eslint-recommended branch July 1, 2024 16:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI approved Approve running CI for fork create-next-app Related to our CLI tool for quickly starting a new Next.js application. Documentation Related to Next.js' official documentation. examples Issue/PR related to examples locked tests type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants