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

chore: bump typescript-eslint to v8 #1936

Merged
merged 6 commits into from
Aug 19, 2024

Conversation

JoshuaKGoldberg
Copy link
Contributor

👋 Hi! Coming over from typescript-eslint/typescript-eslint#9141: we're working on typescript-eslint v8 and would like to try the beta out on repos like this one.

I'm sending this draft PR as a reference to see what issues we might give you in upgrading and to try to be helpful. If this is annoying noise to you, please forgive me, I'll withdraw the PR. But I hope this is useful on your end - and please let me know if you have any feedback! ❤️

I've put inline comments on any changes. There shouldn't be anything user-facing (this isn't a feat: or fix: PR).

For reference, #1476 was a similar PR that bumped typescript-eslint to v6. Hello again! 😄

Copy link

changeset-bot bot commented Jul 6, 2024

🦋 Changeset detected

Latest commit: f12dbe4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-t3-app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jul 6, 2024

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

Name Status Preview Comments Updated (UTC)
create-t3-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2024 8:26am

Copy link

vercel bot commented Jul 6, 2024

@JoshuaKGoldberg is attempting to deploy a commit to the t3-oss Team on Vercel.

A member of the Team first needs to authorize it.

"./upgrade/tsconfig.json",
"./www/tsconfig.json",
],
projectService: true,
Copy link
Contributor Author

@JoshuaKGoldberg JoshuaKGoldberg Jul 6, 2024

Choose a reason for hiding this comment

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

https://typescript-eslint.io/blog/announcing-typescript-eslint-v8-beta#project-service: this is our snazzy new way of enabling typed linting. It should be faster and require less configuration.

I couldn't tell from quickly reading the code: what is the tsconfig.eslint.json doing differently? Is it still necessary?


Btw, I ran hyperfine measurements, and they showed promising performance improvements on my M1 Max Mac Studio:

  • ~10% faster bumping to typescript-eslint from v7 to v8
  • ~20% faster again switching from project to projectService
# baseline: typescript-eslint@v7 with project
Benchmark 1: npx turbo lint --no-cache
  Time (mean ± σ):      7.464 s ±  0.094 s    [User: 32.604 s, System: 2.431 s]
  Range (min … max):    7.346 s …  7.665 s    10 runs
# typescript-eslint@v8 with project
Benchmark 1: npx turbo lint --no-cache
  Time (mean ± σ):      6.662 s ±  0.235 s    [User: 29.944 s, System: 2.253 s]
  Range (min … max):    6.501 s …  7.254 s    10 runs
# typescript-eslint@v8 with projectService
Benchmark 1: npx turbo lint --no-cache
  Time (mean ± σ):      5.344 s ±  0.126 s    [User: 25.637 s, System: 1.683 s]
  Range (min … max):    5.204 s …  5.554 s    10 runs

...for an overall performance improvement of roughly 28%.

Copy link
Member

Choose a reason for hiding this comment

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

I couldn't tell from quickly reading the code: what is the tsconfig.eslint.json doing differently? Is it still necessary?

I can't remember why it's there but from guessing it sounds like projectService does it for us :)

@@ -12,7 +12,7 @@ const isGitInstalled = (dir: string): boolean => {
try {
execSync("git --version", { cwd: dir });
return true;
} 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 typescript-eslint/typescript-eslint#8971, these are now flagged by default by @typescript-eslint/no-unused-vars. They were unused before.

projectName !== "." && logger.info(` cd ${projectName}`);
if (projectName !== ".") {
logger.info(` cd ${projectName}`);
}
Copy link
Contributor Author

@JoshuaKGoldberg JoshuaKGoldberg Jul 6, 2024

Choose a reason for hiding this comment

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

reject();
}
}
)
.on("error", () => {
// logger.error("Unable to check for latest version.");
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
reject();
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 is the first time I can remember seeing reject() called with no argument. Interesting!

@typescript-eslint/prefer-promise-reject-errors was promoted to the strict-type-checked config in v8.

Copy link
Member

Choose a reason for hiding this comment

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

probably should reject with a descriptive error xd

const u = font.match(/src: url\((.+)\) format\('(opentype|truetype)'\)/);
const w = font.match(/font-weight: (\d+)/);
const u = /src: url\((.+)\) format\('(opentype|truetype)'\)/.exec(font);
const w = /font-weight: (\d+)/.exec(font);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -32,7 +32,7 @@ export function getIsRtlFromUrl(pathname: string) {
}

export function getIsRtlFromLangCode(language: KnownLanguageCode) {
if (rtlLanguages.indexOf(language) !== -1) {
if (rtlLanguages.includes(language)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Co-authored-by: Sebastian Barrenechea <sebastian@barrenechea.cl>
@JoshuaKGoldberg
Copy link
Contributor Author

I don't know what's going on with CI, but 🤷 putting in review.

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review August 13, 2024 16:10
@juliusmarminge
Copy link
Member

juliusmarminge commented Aug 19, 2024

I don't know what's going on with CI, but 🤷 putting in review.

This looks like a version mismatch in next-auth's types...

CleanShot 2024-08-19 at 10 08 19

Comment on lines +67 to +69
"resolutions": {
"@typescript-eslint/eslint-plugin": "8.1.0",
"@typescript-eslint/parser": "8.1.0"
Copy link
Member

Choose a reason for hiding this comment

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

can this be removed nnow?

Copy link
Member

Choose a reason for hiding this comment

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

looks like something resolved to v7 when removing this so leaving it in

@juliusmarminge juliusmarminge added this pull request to the merge queue Aug 19, 2024
@juliusmarminge juliusmarminge removed this pull request from the merge queue due to a manual request Aug 19, 2024
@juliusmarminge juliusmarminge merged commit 2d1878e into t3-oss:main Aug 19, 2024
266 of 267 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the typescript-eslint-8 branch August 19, 2024 11:20
@JoshuaKGoldberg
Copy link
Contributor Author

Awesome, thanks @juliusmarminge! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants