Automatic fixes
Oxlint can automatically fix some lint violations. Automatic fixes are only applied when passing the relevant CLI flags. You choose when to apply them.
In the code editor integrations (such as VS Code), automatic fixes are exposed as "code actions" that you can apply in-editor.
Safe fixes
Safe fixes are changes that do not alter program behavior.
Apply safe fixes:
oxlint --fixSuggestions
Suggestions are changes that may alter behavior or may not match your intent.
Apply suggestions:
oxlint --fix-suggestionsDangerous fixes
Dangerous fixes are aggressive changes that may break your code.
Apply dangerous fixes:
oxlint --fix-dangerouslyCombining fix modes
You can combine safe fixes and suggestions:
oxlint --fix --fix-suggestionsYou can also include dangerous fixes:
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:
oxlint --type-aware --fix