Skip to content

fix(linter): Fix false errors for numeric separators (underscores, eg: 2_000_000)#3737

Closed
Shubhashish-Chakraborty wants to merge 6 commits intoprocessing:developfrom
Shubhashish-Chakraborty:red_underscore_fix
Closed

fix(linter): Fix false errors for numeric separators (underscores, eg: 2_000_000)#3737
Shubhashish-Chakraborty wants to merge 6 commits intoprocessing:developfrom
Shubhashish-Chakraborty:red_underscore_fix

Conversation

@Shubhashish-Chakraborty
Copy link
Copy Markdown

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
Copy Markdown
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

@Shubhashish-Chakraborty
Copy link
Copy Markdown
Author

hey @raclim @khanniie , hope y'all having a nice day.. 😄
waiting for y'all response, ive fixed the issue #3709

@khanniie
Copy link
Copy Markdown
Member

khanniie commented Jan 6, 2026

Hi Shubhashish! Happy new year : ) I'm a contributor to the project, but not the lead, so I'm not the right person to review this. Thanks!

@Shubhashish-Chakraborty
Copy link
Copy Markdown
Author

aah Alright, my bad😅
@khanniie

@raclim
Copy link
Copy Markdown
Collaborator

raclim commented Feb 19, 2026

Sorry for taking a while to get back on this and thank you so much for giving this a go!

I think we might not be moving forward with this solution since we currently plan to refactor the Editor component in the develop-codemirror-v6 branch. I'm sorry that we couldn't get this in, but please feel free to check out our other issues that do not have a "Awaiting Maintainer Approval" label or have a "Ready for Work" one!

@raclim raclim closed this Feb 19, 2026
@Shubhashish-Chakraborty
Copy link
Copy Markdown
Author

Alright sure

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

3 participants