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

JavaScript syntax error with v flag in regexp #5462

Open
regseb opened this issue Oct 5, 2024 · 0 comments
Open

JavaScript syntax error with v flag in regexp #5462

regseb opened this issue Oct 5, 2024 · 0 comments

Comments

@regseb
Copy link
Contributor

regseb commented Oct 5, 2024

Describe the problem and steps to reproduce it:

Add-ons Linter doesn't support the v flag (unicodeSets) in regular expression.

const re = /foo/v;

What happened?

  • Code: JS_SYNTAX_ERROR
  • Message: JavaScript syntax error (Parsing as module error: Invalid regular expression flag at line: 3 and column: 14) (Parsing as script error: Invalid regular expression flag at line: 3 and column: 14)
  • Description: There is a JavaScript syntax error in your code, which might be related to some experimental JavaScript features that aren't an official part of the language specification and therefore not supported yet. The validation cannot continue on this file.

What did you expect to happen?

No error.

Anything else we should know?

I think it's the JavaScript parser that doesn't support this new feature. If Add-ons Linter uses ESLint to parse JavaScript files, ESLint 9.10.0 supports v flag. Add-ons Linter uses ESLint 8.57.1 (that is deprecated). Upgrading to v9 requires migrating to FlatConfig. The other eslint-plugin-no-unsanitized dependency has been compatible with ESLint v9 since 4.1.0.

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

1 participant