Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(utils): update types to reflectRuleContext
andSourceCode
changes and deprecations#7812
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
feat(utils): update types to reflectRuleContext
andSourceCode
changes and deprecations#7812
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for the PR,@G-Rath! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint. |
netlifybot commentedOct 20, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site configuration. |
nx-cloudbot commentedOct 20, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Are folks ok if I ignore the deprecation linting errors? I can help getting them addressed but would prefer to do so in dedicated PR since they'll require actual runtime changes and there's a few different ways they can be approached |
Well, we need typescript-eslint to work on both v8 and v9 for the time being. Dropping v8 would be a breaking change. I'd presume |
My point is you'll need to make changes to support v9 since some of these are being removed in that major - it's pretty straight forward (I've already done this in I'll add disable directives for now |
JoshuaKGoldberg commentedOct 22, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Agreed.https://github.com/jest-community/eslint-plugin-jest/blob/3c12c9842df7950dd214855fa69b1785c4d1574d/src/rules/utils/misc.ts is roughly the strategy I'm betting we'll want to take. 🙂 exportconstgetDeclaredVariables=(context:TSESLint.RuleContext<string,unknown[]>,node:TSESTree.Node,)=>{constsourceCode=getSourceCode(context);if('getDeclaredVariables'insourceCode){returnsourceCode.getDeclaredVariables(node);}returncontext.getDeclaredVariables(node);}; |
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.
💯 thanks!
Adding |
Uh oh!
There was an error while loading.Please reload this page.
Thanks again@G-Rath! |
Amusingly, there are now a bunch of lint failures on |
Uh oh!
There was an error while loading.Please reload this page.
PR Checklist
Overview
Reference:https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9