Repository navigation
fix(linter): suggest behavior-changing rewrites and preserve source syntax - #29522
Draft
Aschenbath wants to merge 4 commits into
Draft
Aschenbath wants to merge 4 commits into
Aschenbath wants to merge 4 commits into
Conversation
Contributor
Merging this PR will not alter performance
Comparing Footnotes
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several automatic rule fixes change program behavior or discard source expressions. This moves intentional behavior changes to suggestions and corrects the remaining rewrites covered here, so
--fixpreserves the affected inputs' semantics.eslint/no-unsafe-negation,node/no-exports-assign,promise/no-new-statics, and the Jest/Vitestprefer-comparison-matcher,prefer-expect-resolves, andprefer-to-containrewrites as suggestions. Tests exercise both safe-fix and suggestion modes.expectaliases, message arguments, modifiers, matcher arguments, and surrounding syntax in the call-count matchers. Withholdprefer-called-timesfixes when matcher arguments would be discarded.Closes #29464
Closes #29466
Closes #29474
Closes #29475
Closes #29476
Closes #29480
Closes #29482
Closes #29483
Closes #29487
Closes #29488
Closes #29490
These are the native issues from the #16911 safety audit that did not already have linked PRs when checked. The other 22 reported rule cases remain covered by #29309 and #29493–#29512; this PR does not resolve the whole audit by itself.
Validation:
cargo test --all-features -p oxc_linter: 1,319 unit tests plus integration and doc tests passed; 7 existing doc tests ignored.cargo lintgen,just lint -p oxc_linter, andjust doc -p oxc_linterpassed. Generated rule runner files are unchanged.AI disclosure: OpenAI Codex was used to implement, review, and test this change.