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

linter: formatter reports utf-8 index while eslint reports in utf-16 #9110

Open
hi-ogawa opened this issue Feb 14, 2025 · 0 comments
Open

linter: formatter reports utf-8 index while eslint reports in utf-16 #9110

hi-ogawa opened this issue Feb 14, 2025 · 0 comments
Assignees
Labels
A-linter Area - Linter C-bug Category - Bug

Comments

@hi-ogawa
Copy link
Contributor

hi-ogawa commented Feb 14, 2025

What version of Oxlint are you using?

0.15.10

What command did you run?

pnpm dlx oxlint -D no-debugger repro.js

What does your .oxlintrc.json config file look like?

None

What happened?

The code of repro.js

"🤨"; debugger;

The commands output

$ pnpm dlx eslint --no-config-lookup --rule 'no-debugger: error' repro.js

/home/hiroshi/code/others/oxc/repro.js
  1:7  error  Unexpected 'debugger' statement  no-debugger

✖ 1 problem (1 error, 0 warnings)


$ pnpm dlx oxlint -D no-debugger repro.js

  × eslint(no-debugger): `debugger` statement is not allowed
   ╭─[repro.js:1:9]
 1 │ "🤨"; debugger;
   ·       ─────────
   ╰────
  help: Delete this code.

Found 0 warnings and 1 error.
Finished in 5ms on 1 file with 97 rules using 16 threads.

I'm not sure if this has been discussed, but bringing this up just in case as I'm wondering whether terminal output is fine with column index in utf-8. For example, on Vsocde's terminal, clicking repro.js:1:9 jumps to the 3rd character b of debugger.

Interestingly, language server protocol seems to have a knowledge about encoding, so it's reported correctly on Vscode extension.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-bug Category - Bug
Projects
None yet
Development

No branches or pull requests

2 participants