Skip to content

Conversation

@Shubhashish-Chakraborty

Fixes #3709

Problem: The code linter (JSHint) was incorrectly flagging valid ES2021 numeric separators (e.g., 1_000_000) as syntax errors. This resulted in red underlines and "Unexpected '_'" messages in the editor, even though the syntax is valid and supported in modern JavaScript.

Changes:

  • I wrapped the standard linter function (CodeMirror.lint.javascript) to act as a "middleman." This allows your code to catch the error report before it gets sent to the editor interface.
  • I added logic that checks the actual code for numeric separators (using the regex /\d+_\d+/). If found, it specifically filters out "unexpected token" or "underscore" errors, ensuring only real syntax errors are shown to the user.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

@Shubhashish-Chakraborty
Copy link
Author

The Review is pending for a long time, why is it taking so much time..??
by the way the issue is fixed, so just waiting for y'all approval..
@raclim @khanniie

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

Successfully merging this pull request may close these issues.

Using underscores to make numbers more visible produces red underscores with the linter

1 participant