-
Notifications
You must be signed in to change notification settings - Fork 39
Conversation
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.
Hey, thanks for the PR and sorry for a delayed review!
Just left one comment, otherwise looks good!
79c17fe
to
665f68a
Compare
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 good!
Hmm, something wrong with the build on CI, do you know why it cannot fine |
Since no moduleResolution is specified in this project's tsconfig, it seems it defaults to 'node': It should probably be updated to either |
Omg, I hope this is not going to bring a full can of worms where all relative imports will have to end with |
Tried to add that as a new commit now, so we'll see! 🤞 |
Seems like the import still does not work in tests, maybe tsconfig for tests also needs similar fix? |
Yeah, will at least need to also install |
The 6.x branch of typescript-eslint requires at least eslint 7.x and typescript 4.2.4 It has also dropped support for node 12 and node 17.
This updates to a more modern moduleResolution, from the default of node/node10. Relevant typescript-eslint issue: typescript-eslint/typescript-eslint#7284
2f32ac9
to
8015a0a
Compare
Updated tsconfig for tests as well now + installed the missing new package. Let's see if that does the trick! |
Looks like tests are working now but there are still build errors and also a BC check for eslint v7 fails to install dependencies most likely because of new added dependencies which are not compatible with the older v7 major and should be removed before old versions are installed. |
Yeah, the new rule-tester package seems to be making things complicated, by only supporting eslint >=8 and eslintrc >= 2. But I guess we don't need to install version 4 of typescript-eslint packages to test eslint 7. The latest versions of typescript-eslint packages still support eslint 7. Looks from git history like that is leftover code all the way back initially creating those back-compat tests in 2021. Some type errors I still need to figure out. services.program is typed as nullable now, but I'm not sure if that's relevant or if we can jsut safely use a new type that ensure it is always present (since type checking is marked as required for this rule): |
src/rules/deprecation.ts
Outdated
recommended: 'warn', | ||
recommended: 'recommended', |
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.
What does this thing affect in docs btw?
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.
Actually, I think we may want to delete this line – I couldn't find that the previous way of setting recommended: 'warn' makes sense for custom rules in typescript-eslint either, and it doesn't match the fact that it's set to 'error' in this package's recommended config:
'deprecation/deprecation': 'error', |
typescript-eslint themselves reworked their 'recommended' setup, into multiple new configs, which is why the types have changes, but the property does not seem to be documented.
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.
Hmm, okay then let's delete it altogether because it does not make any sense with recommended
value anyway 😊
I guess it's marked as nullable in cases if typescript parser is not setup with eslint. Maybe we can catch this early in the rule and throw an error saying that typescript parser is required and link to this doc section? |
Seems like UPDATE: Quick googling shows that some ppl also struggled with this when rules were upgraded to eslint 8 and they did something like this to support both eslint v7 and v8 (yeah ugly). |
Ah, ofc. Yeah, the new package only supports eslint 8 (at least as declared by its peerDependencies). Since the previous import of RuleTester is actually from |
0b63cf8
to
59f0d19
Compare
Still remain to figure out a way to detect whether type checking information is available, but pushed an experimental commit that attempts to install a parallel version of @typescript-eslint/utils only to use for getting a fallback RuleTester now. |
59f0d19
to
8090a3e
Compare
8090a3e
to
8218d7c
Compare
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.
Oh well this already looks great, thanks for your efforts!
Just one more small thing from me 😊
8218d7c
to
74d76dd
Compare
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.
Hey it's working! Thanks for such a great effort to fix all the issues, I appreciate it!
I will merge it as a major change since we've dropped some major versions support.
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
BREAKING CHANGE: Dropped support for ESLint v6 and Typescript v3.7.5, please make sure to use at least ESLint v7 with Typescript v4.2 or downgrade to a previous major version.
The 6.x branch of typescript-eslint requires at least eslint 7.x and typescript 4.2.4
It has also dropped support for node 12 and node 17.