8000 linter: bunch of small auto-fix missing · Issue #10477 · oxc-project/oxc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

linter: bunch of small auto-fix missing #10477

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

Open
6 of 9 tasks
Hideman42 opened this issue Apr 17, 2025 · 5 comments
Open
6 of 9 tasks

linter: bunch of small auto-fix missing #10477

Hideman42 opened this issue Apr 17, 2025 · 5 comments
Assignees
Labels
A-linter Area - Linter E-Help Wanted Experience level - For the experienced collaborators good first issue Experience Level - Good for newcomers

Comments

@Hideman42
Copy link
Hideman42 commented Apr 17, 2025

What version of Oxlint are you using?

0.16.5

What command did you run?

oxlint --fix --fix-suggestions --quiet

What happened?

Missing lot of quick auto-fixes:

  • eslint-plugin-unicorn(prefer-number-properties): Use Number.parseFloat instead of the global parseFloat => Same for parseInt, isNaN feat(linter): implement fixer for unicorn/prefer-number-properties #10693
    • Should add Number. before parseFloat
  • eslint(radix): Missing radix parameter feat(linter): add auto-fix for eslint/radix #10652
    • Should add , 10 in the code as Number.parseInt(str, 10)
  • eslint-plugin-unicorn(prefer-spread): Prefer the spread operator (...) over Array.from()
  • eslint-plugin-react(jsx-curly-brace-presence): Curly braces are unnecessary here
    • Should replace <div id={'my-div'} /> with <div id="my-div" />
  • eslint(require-await): Async function has no 'await' expression
    • Should strip out async // Maybe a dangerous fix
  • eslint-plugin-react(self-closing-comp): Unnecessary closing tag
    • Should replace to self closing tag
  • eslint-plugin-react(jsx-no-useless-fragment): Fragments should contain more than one child. feat(linter): implement suggestion for jsx/no-useless-fragment #10800
    • Should replace to <></> with null <>{something}</> with something
  • eslint(eqeqeq): Expected === and instead saw ==
    • Should replace == to ===
  • eslint-plugin-react(exhaustive-deps): React Hook useMyHook has a missing dependency myDep
    • Should add to the dependencies array myDep
@Hideman42 Hideman42 added the A-linter Area - Linter label Apr 17, 2025
@Hideman42 Hideman42 changed the title linter: linter: bunch of small auto-fix missing Apr 17, 2025
@Dunqing Dunqing added E-Help Wanted Experience level - For the experienced collaborators good first issue Experience Level - Good for newcomers labels Apr 18, 2025
@Dunqing
Copy link
Member
Dunqing commented Apr 18, 2025

Thank you for such a useful issue to help us improve!

@Miodec
Copy link
Miodec commented Apr 18, 2025

Just a heads up (since you mentioned youre using --fix and --fix-suggestions flags), eqeqeq should be a dangerous fix since just blindly changing == to === can change the logic.

@Hideman42
Copy link
Author
Hideman42 commented Apr 18, 2025

Just a heads up (since you mentioned youre using --fix and --fix-suggestions flags), eqeqeq should be a dangerous fix since just blindly changing == to === can change the logic.

I think this is fair to have it as dangerous fix. Something is weird tho, I went to the rules doc and it is tagged as auto-fixable (safe) and I checked the rule source it seem to have a fix implemented but with oxlint --fix --fix-suggestions --fix-dangerously --quiet it doesnt auto fix it. Do you also confirm in your try?

@camchenry
Copy link
Member

@Hideman42 I'll take a look at this. I think it is only safely auto fixable in some cases. But we could provide it as a dangerous fix in all cases.

@camchenry camchenry self-assigned this Apr 18, 2025
graphite-app bot pushed a commit that referenced this issue Apr 19, 2025
- Related to #10477

This allows the `eqeqeq` rule to always be fixable if dangerous fixes are allowed, but will apply the safe fix if the circumstances apply.
@Hideman42
Copy link
Author

I added another usefull small auto-fix to the list, the eslint-plugin-react(exhaustive-deps) to add needed dependencies to the array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter E-Help Wanted Experience level - For the experienced collaborators good first issue Experie 3E27 nce Level - Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants
0