Skip to content
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

TypeError: this.context.getSource is not a function #243

Closed
onemen opened this issue Jul 6, 2024 · 2 comments
Closed

TypeError: this.context.getSource is not a function #243

onemen opened this issue Jul 6, 2024 · 2 comments

Comments

@onemen
Copy link

onemen commented Jul 6, 2024

This error prevnets us using this plugin with eslint 9
TypeError: this.context.getSource is not a function

https://github.com/mozilla/eslint-plugin-no-unsanitized/blame/7835bfdd6f48e8e4f49ade7efd59318acc49e42b/lib/ruleHelper.js#L316-L317

there is a simple fix

-                   (this.context.sourceCode?.getText
-                       ? this.context.sourceCode.getText(node.object)
+                   (this.context.sourceCode?.getSource
+                       ? this.context.sourceCode.getSource(node.object)
                        : this.context.getSource(node.object));
@onemen
Copy link
Author

onemen commented Jul 6, 2024

sorry,

it look like commit d9704a7 does not included in the current version 4.0.2

@onemen onemen closed this as completed Jul 6, 2024
@mozfreddyb
Copy link
Collaborator

We're somewhat blocked on #241 unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants