feat: use typescript-eslint@v6's reworked configs#7425
feat: use typescript-eslint@v6's reworked configs#7425bluwy merged 14 commits intowithastro:mainfrom
Conversation
|
| "test:e2e:match": "cd packages/astro && pnpm playwright install && pnpm run test:e2e:match", | ||
| "benchmark": "astro-benchmark", | ||
| "lint": "eslint --cache .", | ||
| "lint": "eslint . --report-unused-disable-directives", |
There was a problem hiding this comment.
Not strictly necessary, but I've found this to be a nice cleanup.
There was a problem hiding this comment.
I think we'd want to still keep the --cache too?
There was a problem hiding this comment.
Ehh I've found the cache to be ... unreliable when working with type checking. Theoretically a file's lint result could be impacted by a couple of other factors -other files it imports types from, TSConfig settings- so caching becomes difficult.
There was a problem hiding this comment.
I won't deny that I've seen --cache acting strange before, so I could be persuaded removing it for now if there's no rejections from others.
| try { | ||
| wrappedError.stack = err.stack; | ||
| // @ts-expect-error | ||
| wrappedError.cause = err; |
There was a problem hiding this comment.
I added target: ES2022 in the tsconfig.json so this line wouldn't need a // @ts-expect-error.
ematipico
left a comment
There was a problem hiding this comment.
I noticed that some changes use the bang operator !. I consider this very unsafe, and I wonder if we should change our code there or at least leave some comments explaining why it's safe. cc @withastro/maintainers-core
...works on my machine! (as in, |
| @@ -1,23 +1,53 @@ | |||
| module.exports = { | |||
| extends: [ | |||
There was a problem hiding this comment.
I wonder, since this is a breaking change, should we try to move to use the new eslint configuration format? https://eslint.org/docs/latest/use/configure/configuration-files-new
Changes
Posting this as a reference for https://discord.com/channels/830184174198718474/845430950191038464/1120563248782114986:
Edit: the response there was positive, so un-drafting! Thanks!
Upgraded typescript-eslint to v6, with reworked ESLint configurations.
You can read https://typescript-eslint.io/blog/announcing-typescript-eslint-v6-beta#user-facing-breaking-changes for the rationale behind the config changes. Essentially, the new recommended starter configs are:
"plugin:@typescript-eslint/recommended-type-checked""plugin:@typescript-eslint/stylistic-type-checked"I've commented any changes I suspect you might disagree with inline, for discussion. Would love to know what you all think!