-
Notifications
You must be signed in to change notification settings - Fork 12
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
Update guard-define-call
rule for eslint 9 compat
#143
Update guard-define-call
rule for eslint 9 compat
#143
Conversation
src/rules/guard-define-call.ts
Outdated
@@ -27,7 +27,7 @@ const rule: Rule.RuleModule = { | |||
|
|||
create(context): Rule.RuleListener { | |||
const definedCustomElements = new Set<string>(); | |||
|
|||
const sourceCode = context.sourceCode ?? context.getSourceCode(); |
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.
context.sourceCode
was introduced in 9.x iirc, so we may not need to do this
pretty sure we have other places where we depend on >=9
too (though happy to be proven wrong!)
left 2 comments but the overall question here is what our effective support is currently i assumed we already required |
Ok @43081j that makes sense. I tested this out on our end, and it looks to be working as expected. Thanks! |
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 double checked and this does seem right 👍
we use context.sourceCode
throughout the repo, so we are already depending on >=8.4
(as per package.json
too)
and source.getAncestors
existed since around then too
@43081j - thanks! Do you know when the next release will happen? |
https://github.com/43081j/eslint-plugin-wc/releases/tag/2.2.1 could you try it out @gracepark and let me know if all is good? |
It works for me, thank you so much @43081j! |
I was running into some compatibility issues with ESLint 9 for the
guard-define-call
rule:Tested out the rule update: https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context.getancestors() and this looks to fix the issue.