Skip to content

Commit 7419dfb

Browse files
committed
fix(linter): remove invalid debug assersion, add test (#18819)
debug asserion could fail if the json was not a valid oxlintrc
1 parent 0ca6269 commit 7419dfb

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

apps/oxlint/src/js_config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ fn parse_js_config_response(json: &str) -> Result<Vec<JsConfigResult>, Vec<OxcDi
8484
let mut oxlintrc: Oxlintrc = match serde_json::from_value(entry.config) {
8585
Ok(config) => config,
8686
Err(err) => {
87-
debug_assert!(false, "All JS configs should be valid JSON");
8887
errors.push(
8988
OxcDiagnostic::error(format!(
9089
"Failed to parse config from {}",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from "#oxlint";
2+
3+
export default defineConfig({
4+
rules: [],
5+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("hi");
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Exit code
2+
1
3+
4+
# stdout
5+
```
6+
Failed to parse oxlint configuration file.
7+
8+
x Failed to parse config from <fixture>/files/oxlint.config.ts
9+
note: invalid type: sequence, expected Record<string, SeverityConf | [SeverityConf, ...any[]]>
10+
```
11+
12+
# stderr
13+
```
14+
```

0 commit comments

Comments
 (0)