8000 chore: bump typescript-eslint to v8 with project service by JoshuaKGoldberg · Pull Request #5868 · trpc/trpc · GitHub
[go: up one dir, main page]

Skip to content

chore: bump typescript-eslint to v8 with project service #5868

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

Closed

Conversation

JoshuaKGoldberg
Copy link
Contributor
@JoshuaKGoldberg JoshuaKGoldberg commented Jul 5, 2024

Closes #5867

🎯 Changes

  1. Updates typescript-eslint to the latest v8 beta, rc-v8
    • Also eslint to typescript-eslint's minimum supported version, and prettier to deduplicate shared dependency versions
  2. Enables the new parserOptions.projectService, simplifying the ESLint config a bit
  3. For any rule newly enabled via the preset configs that produced a lot of errors, disabled under a TODO in the ESLint config

Note that this is still a beta version of typescript-eslint@v8. So unless you want to live on the edge, I'd suggest waiting until we hit stable this summer to merge.

✅ Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

Copy link
vercel bot commented Jul 5, 2024

@JoshuaKGoldberg is attempting to deploy a commit to the trpc Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
vercel bot commented Jul 5, 2024

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

Name Status Preview Comments Updated (UTC)
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 5, 2024 6:50pm

@@ -3,7 +3,7 @@
* This file is included in `/next.config.js` which ensures the app isn't built with invalid env vars.
* It has to be a `.js`-file to be imported there.
*/
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-require-imports */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typescript-eslint/typescript-eslint#8334: we merged the two rules into the one no-require-imports.

@@ -221,6 +221,7 @@ export default function TodosPage(props: PageProps) {

<input
className="new-todo"
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
placeholder={t('what_needs_to_be_done') as string}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one stumped me. I couldn't reproduce it in a standalone repro: https://github.com/JoshuaKGoldberg/repros/tree/next-18n-and-type-assertion.

...are there some custom fancy types getting added? I time boxed investigating and couldn't find any.

@@ -55,6 +55,7 @@ export function Chat(props: Readonly<{ channelId: string }>) {
livePosts.query.isFetchingNextPage
}
onClick={() => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
livePosts.query.fetchNextPage();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this wasn't flagging before. But it's a legit rule violation.

@@ -59,7 +59,7 @@ export const ssrPrepass: TRPCPrepassHelper = (opts) => {
if (typeof parent.ssr === 'function') {
try {
return await parent.ssr({ ctx: appOrPageCtx.ctx });
} catch (e) {
} catch {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of eslint/eslint#17974 -> eslint/eslint#18043, these are now flagged by default by no-unused-vars. They were unused before.

@@ -133,7 +133,7 @@ export function createAppRouter() {
const last = items[items.length - 1];
const nextIndex = db.posts.findIndex((item) => item === last) + 1;
if (db.posts[nextIndex]) {
nextCursor = db.posts[nextIndex]!.createdAt;
nextCursor = db.posts[nextIndex].createdAt;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know which bug was fixed here, but this is a legit unnecessary !.

@@ -120,7 +120,7 @@ export async function generateEntrypoints(rawInputs: string[]) {
pkgJson.funding = ['https://trpc.io/sponsor'];

// write package.json
const formattedPkgJson = prettier.format(JSON.stringify(pkgJson), {
const formattedPkgJson = await prettier.format(JSON.stringify(pkgJson), {
Copy link
Contributor Author
@JoshuaKGoldberg JoshuaKGoldberg Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These come from the Prettier update to v3.

#5869 includes that update and subsequent formatting updates.

@KATT
Copy link
Member
KATT commented Jul 5, 2024

I got a big branch that will conflict with this (#5865) so hope the changes are mainly automatic

@JoshuaKGoldberg
Copy link
Contributor Author

Oh fun!

Yes, these are mostly automatic. I don't mind recreating as needed. 🙂

@Nick-Lucas
Copy link
Contributor

Hey @JoshuaKGoldberg this has been idle for quite a long time so I'm going to close it out. The contribution would be very welcome though if you want to re-open

@Nick-Lucas Nick-Lucas closed this Oct 5, 2024
Copy link
github-actions bot commented Oct 6, 2024

This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 2024
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.

feat: use typescript-eslint@v8 with project service
3 participants
0