-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
chore: bump typescript-eslint to v8 #1936
Conversation
🦋 Changeset detectedLatest commit: f12dbe4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@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, |
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.
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
toprojectService
# 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%.
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.
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 { |
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.
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}`); | ||
} |
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.
@typescript-eslint/no-unused-expressions
was promoted to the recommended
config in v8.
reject(); | ||
} | ||
} | ||
) | ||
.on("error", () => { | ||
// logger.error("Unable to check for latest version."); | ||
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors | ||
reject(); |
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.
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.
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.
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); |
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.
@typescript-eslint/prefer-regexp-exec
was promoted to the stylistic-type-checked
config in v8.
@@ -32,7 +32,7 @@ export function getIsRtlFromUrl(pathname: string) { | |||
} | |||
|
|||
export function getIsRtlFromLangCode(language: KnownLanguageCode) { | |||
if (rtlLanguages.indexOf(language) !== -1) { | |||
if (rtlLanguages.includes(language)) { |
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.
@typescript-eslint/prefer-includes
was promoted to the stylistic-type-checked
config in v8.
Co-authored-by: Sebastian Barrenechea <sebastian@barrenechea.cl>
I don't know what's going on with CI, but 🤷 putting in review. |
"resolutions": { | ||
"@typescript-eslint/eslint-plugin": "8.1.0", | ||
"@typescript-eslint/parser": "8.1.0" |
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.
can this be removed nnow?
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.
looks like something resolved to v7 when removing this so leaving it in
Awesome, thanks @juliusmarminge! ❤️ |
👋 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:
orfix:
PR).For reference, #1476 was a similar PR that bumped typescript-eslint to v6. Hello again! 😄