Automatic fixes ​
Oxlint can automatically fix some lint violations. Automatic fixes are not enabled by default. You choose when to apply them.
Safe fixes ​
Safe fixes are changes that do not alter program behavior.
Apply safe fixes:
bash
oxlint --fixSuggestions ​
Suggestions are changes that may alter behavior or may not match your intent.
Apply suggestions:
bash
oxlint --fix-suggestionsDangerous fixes ​
Dangerous fixes are aggressive changes that may break your code.
Apply dangerous fixes:
bash
oxlint --fix-dangerouslyCombining fix modes ​
You can combine safe fixes and suggestions:
bash
oxlint --fix --fix-suggestionsYou can also include dangerous fixes:
bash
oxlint --fix --fix-suggestions --fix-dangerouslyRule support ​
Not all rules provide fixes. Some rules support safe fixes, some provide suggestions, and some do not provide fixes yet.
If a rule is missing a fixer, contributions are welcome.
Type aware linting and fixes ​
Type aware linting requires building the project.
You can apply safe fixes with type aware linting enabled:
bash
oxlint --type-aware --fix