Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/oxlint/fixtures/extends_config/empty_config.json

This file was deleted.

1 change: 1 addition & 0 deletions crates/oxc_linter/fixtures/extends_config/console.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("test");
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["./rules_config.json"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["jsx.json", "./typescript.json"],
"rules": {
"no-unused-vars": "off"
}
}
11 changes: 11 additions & 0 deletions crates/oxc_linter/fixtures/extends_config/overrides/jsx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": ["jsx-a11y"],
"overrides": [
{
"files": ["*.{jsx,tsx}"],
"rules": {
"jsx-a11y/anchor-ambiguous-text": "error"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const x: any = 3;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function component(): any {
return <a>click here</a>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"overrides": [
{
"files": ["*.{ts,tsx}"],
"plugins": ["typescript"],
"rules": {
"@typescript-eslint/no-explicit-any": "error"
}
}
]
}
7 changes: 7 additions & 0 deletions crates/oxc_linter/fixtures/extends_config/rules_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"rules": {
"no-debugger": "off",
"no-console": "error",
"unicorn/no-null": "error"
}
}
43 changes: 21 additions & 22 deletions crates/oxc_linter/src/config/config_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,13 +744,12 @@ mod test {

#[test]
fn test_extends_rules_single() {
let base_config =
config_store_from_path("../../apps/oxlint/fixtures/extends_config/rules_config.json");
let base_config = config_store_from_path("fixtures/extends_config/rules_config.json");
let derived_config = config_store_from_str(
r#"
{
"extends": [
"../../apps/oxlint/fixtures/extends_config/rules_config.json"
"fixtures/extends_config/rules_config.json"
]
}
"#,
Expand All @@ -762,7 +761,7 @@ mod test {
r#"
{
"extends": [
"../../apps/oxlint/fixtures/extends_config/rules_config.json"
"fixtures/extends_config/rules_config.json"
],
"rules": {
"no-debugger": "warn",
Expand Down Expand Up @@ -806,9 +805,9 @@ mod test {
r#"
{
"extends": [
"../../apps/oxlint/fixtures/extends_config/rules_multiple/allow_all.json",
"../../apps/oxlint/fixtures/extends_config/rules_multiple/deny_all.json",
"../../apps/oxlint/fixtures/extends_config/rules_multiple/warn_all.json"
"fixtures/extends_config/rules_multiple/allow_all.json",
"fixtures/extends_config/rules_multiple/deny_all.json",
"fixtures/extends_config/rules_multiple/warn_all.json"
]
}
"#,
Expand All @@ -819,9 +818,9 @@ mod test {
r#"
{
"extends": [
"../../apps/oxlint/fixtures/extends_config/rules_multiple/allow_all.json",
"../../apps/oxlint/fixtures/extends_config/rules_multiple/warn_all.json",
"../../apps/oxlint/fixtures/extends_config/rules_multiple/deny_all.json"
"fixtures/extends_config/rules_multiple/allow_all.json",
"fixtures/extends_config/rules_multiple/warn_all.json",
"fixtures/extends_config/rules_multiple/deny_all.json"
]
}
"#,
Expand All @@ -832,9 +831,9 @@ mod test {
r#"
{
"extends": [
"../../apps/oxlint/fixtures/extends_config/rules_multiple/warn_all.json",
"../../apps/oxlint/fixtures/extends_config/rules_multiple/deny_all.json",
"../../apps/oxlint/fixtures/extends_config/rules_multiple/allow_all.json"
"fixtures/extends_config/rules_multiple/warn_all.json",
"fixtures/extends_config/rules_multiple/deny_all.json",
"fixtures/extends_config/rules_multiple/allow_all.json"
]
}
"#,
Expand All @@ -846,8 +845,8 @@ mod test {
r#"
{
"extends": [
"../../apps/oxlint/fixtures/extends_config/rules_multiple/deny_all.json",
"../../apps/oxlint/fixtures/extends_config/rules_multiple/allow_all.json"
"fixtures/extends_config/rules_multiple/deny_all.json",
"fixtures/extends_config/rules_multiple/allow_all.json"
],
"rules": {
"no-var": "warn",
Expand Down Expand Up @@ -882,7 +881,7 @@ mod test {
let invalid_config = ConfigStoreBuilder::from_oxlintrc(
true,
Oxlintrc::from_file(&PathBuf::from(
"../../apps/oxlint/fixtures/extends_config/extends_invalid_config.json",
"fixtures/extends_config/extends_invalid_config.json",
))
.unwrap(),
);
Expand All @@ -900,8 +899,8 @@ mod test {
r#"
{
"extends": [
"../../apps/oxlint/fixtures/extends_config/plugins/jest.json",
"../../apps/oxlint/fixtures/extends_config/plugins/react.json"
"fixtures/extends_config/plugins/jest.json",
"fixtures/extends_config/plugins/react.json"
]
}
"#,
Expand All @@ -915,8 +914,8 @@ mod test {
r#"
{
"extends": [
"../../apps/oxlint/fixtures/extends_config/plugins/jest.json",
"../../apps/oxlint/fixtures/extends_config/plugins/react.json"
"fixtures/extends_config/plugins/jest.json",
"fixtures/extends_config/plugins/react.json"
],
"plugins": ["typescript"]
}
Expand All @@ -933,8 +932,8 @@ mod test {
r#"
{
"extends": [
"../../apps/oxlint/fixtures/extends_config/plugins/jest.json",
"../../apps/oxlint/fixtures/extends_config/plugins/react.json"
"fixtures/extends_config/plugins/jest.json",
"fixtures/extends_config/plugins/react.json"
],
"plugins": []
}
Expand Down
Loading