-
-
Notifications
You must be signed in to change notification settings - Fork 841
fix(linter): reverse extends overrides priority #14939
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "overrides": [ | ||
| { | ||
| "files": ["*.test.ts"], | ||
| "rules": { | ||
| "no-const-assign": "error" | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "extends": ["./base_override.json"], | ||
| "overrides": [ | ||
| { | ||
| "files": ["*.test.ts"], | ||
| "rules": { | ||
| "no-const-assign": "off" | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -218,7 +218,7 @@ impl Oxlintrc { | |
| /// Merges two [Oxlintrc] files together | ||
| /// [Self] takes priority over `other` | ||
| #[must_use] | ||
| pub fn merge(&self, other: Oxlintrc) -> Oxlintrc { | ||
| pub fn merge(&self, other: &Oxlintrc) -> Oxlintrc { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing I know taking an owned Could you revert that change please? |
||
| let mut categories = other.categories.clone(); | ||
| categories.extend(self.categories.iter()); | ||
|
|
||
|
|
@@ -242,8 +242,8 @@ impl Oxlintrc { | |
| let env = self.env.clone(); | ||
| let globals = self.globals.clone(); | ||
|
|
||
| let mut overrides = self.overrides.clone(); | ||
| overrides.extend(other.overrides); | ||
| let mut overrides = other.overrides.clone(); | ||
| overrides.extend(self.overrides.clone()); | ||
|
|
||
| let plugins = match (self.plugins, other.plugins) { | ||
| (Some(self_plugins), Some(other_plugins)) => Some(self_plugins | other_plugins), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment still accurate? If not, please update it.
Given that this is a bit confusing (hence why implementation was wrong before this PR), it'd also be helpful to expand this comment with an example of what merging looks like - show who wins when
selfandotherboth have the same property.