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

feat(linter): Support potentially dangerous fixes behind a --fix-dangerously flag #4211

Closed
3 tasks
Tracked by #4179
DonIsaac opened this issue Jul 11, 2024 · 3 comments · Fixed by #4223
Closed
3 tasks
Tracked by #4179

feat(linter): Support potentially dangerous fixes behind a --fix-dangerously flag #4211

DonIsaac opened this issue Jul 11, 2024 · 3 comments · Fixed by #4223
Labels
A-linter Area - Linter C-enhancement Category - New feature or request E-Help Wanted Experience level - For the experienced collaborators

Comments

@DonIsaac
Copy link
Collaborator

DonIsaac commented Jul 11, 2024

Some problems are potentially auto fixable, but doing so may be undesireable. In some cases, it could produce incorrect code. In other cases, it could change the behavior of applications.

ESLint handles this with Rule Suggestions, which are made available to language servers but do not get applied via --fix.

Since the linter is mostly used as a CLI (oxlint), we need to support applying suggestions there too. I think we should do this with a --fix-dangerously flag.

Tasks

NOTE: only the first two tasks are prerequisites for #4179

  • refactor(linter): update FIx to support suggestions
  • feat(cli): add --fix-dangerously flag
  • feat(lsp): add command to apply suggestions
@DonIsaac DonIsaac added C-enhancement Category - New feature or request A-linter Area - Linter E-Help Wanted Experience level - For the experienced collaborators labels Jul 11, 2024
@Boshen
Copy link
Member

Boshen commented Jul 12, 2024

Interesting, can you hold onto adding the flag and the command? I want to research and understand these first.

@DonIsaac
Copy link
Collaborator Author

DonIsaac commented Jul 12, 2024

Too late unfortunately, I've got a draft out already. I'll avoid merging it until you confirm though.

@DonIsaac
Copy link
Collaborator Author

We may also want to support multiple suggestions for each diagnostic.

@DonIsaac DonIsaac linked a pull request Jul 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-enhancement Category - New feature or request E-Help Wanted Experience level - For the experienced collaborators
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants