feat(linter): add no-redeclare rule.#683
Merged
Boshen merged 28 commits intooxc-project:mainfrom Sep 23, 2023
Merged
Conversation
DonIsaac
suggested changes
Aug 3, 2023
Boshen
reviewed
Aug 4, 2023
Boshen
requested changes
Sep 7, 2023
Member
Boshen
left a comment
There was a problem hiding this comment.
Nice! You understood the essence of the semantic builder!
Now to the cool part:
If you take a look at any other rules that report duplications or redeclarations, you can see the diagnostic points to both spans:
#[derive(Debug, Error, Diagnostic)]
#[error("Identifier `{0}` has already been declared")]
#[diagnostic()]
pub struct Redeclaration(
pub Atom,
#[label("`{0}` has already been declared here")] pub Span,
#[label("It can not be redeclared here")] pub Span,
);This gives the user the most intuitive way to see what is wrong with the code.
So let's give it a try and add this.
…t/no-redeclare * 'feat/no-redeclare' of github.com:eryue0220/oxc:
CodSpeed Performance ReportMerging #683 will not alter performanceComparing Summary
|
Boshen
reviewed
Sep 8, 2023
Boshen
reviewed
Sep 9, 2023
…t/no-redeclare * 'feat/no-redeclare' of github.com:eryue0220/oxc: (22 commits) deps: remove default-features from codspeed-criterion-compat chore(deps): bump the dependencies group with 4 updates (oxc-project#893) chore(deps): bump actions/checkout from 3 to 4 (oxc-project#894) feat(minifier): constant addition expression folding (oxc-project#882) chore(benchmark): turn on all lints (oxc-project#892) feat(linter): eslint-plugin-import(no-cycle) (oxc-project#890) chore: fix typo (oxc-project#889) perf(linter): early bail out if not jest fn (oxc-project#885) feat(linter): add typescript/no-explicit-any (oxc-project#881) feat(website): Hide error panel when query view is shown (oxc-project#884) fix(website): fix run_query call arguments (oxc-project#880) feat(linter): eslint-plugin-import/no-self-import (oxc-project#878) feat(linter): implement re-exports (oxc-project#877) ci(benchmark): install toolchain first refactor(resolver): clean up `load_alias` (oxc-project#875) fix(parser): parse [+In] in object binding initializer (oxc-project#874) chore(fuzz): add --sanitizer none command chore(fuzz): add nightly instructions refactor: clean up fuzzer, move it to repo root (oxc-project#872) perf(resolver): avoid double hashing by memoizing the hash (oxc-project#871) ...
Boshen
reviewed
Sep 11, 2023
Boshen
approved these changes
Sep 12, 2023
Boshen
requested changes
Sep 12, 2023
Boshen
reviewed
Sep 12, 2023
Contributor
Author
|
I think we can merge once if the ci pass. And some cases maybe fixed in later. |
Boshen
approved these changes
Sep 23, 2023
Member
|
Thank you for being patient with me! |
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.
Close: #615 #520
Rule: Docs
Notes:
Currently, I still tried to implement the
no-redeclare, Some tests doesn't pass now.