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
3 changes: 3 additions & 0 deletions apps/oxlint/fixtures/tsgolint/config-test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["./extended-config.json"]
}
16 changes: 16 additions & 0 deletions apps/oxlint/fixtures/tsgolint/extended-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"categories": {
"correctness": "off"
},
"rules": {
"no-debugger": "error"
},
"overrides": [
{
"files": ["*.ts"],
"rules": {
"typescript/no-floating-promises": "warn"
}
}
]
}
7 changes: 7 additions & 0 deletions apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,4 +1221,11 @@ mod test {
let args = &["--type-aware"];
Tester::new().with_cwd("fixtures/tsgolint".into()).test_and_snapshot(args);
}

#[test]
#[cfg(not(any(target_os = "windows", target_endian = "big")))]
fn test_tsgolint_config() {
let args = &["--type-aware", "-c", "config-test.json"];
Tester::new().with_cwd("fixtures/tsgolint".into()).test_and_snapshot(args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
source: apps/oxlint/src/tester.rs
---
##########
arguments: --type-aware -c config-test.json
working directory: fixtures/tsgolint
----------

! typescript-eslint(no-floating-promises): Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void`
| operator.
,-[no-floating-promises/index.ts:2:1]
1 | const promise = new Promise((resolve, _reject) => resolve("value"));
2 | promise;
: ^^^^^^^^
3 |
`----

! typescript-eslint(no-floating-promises): Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void`
| operator.
,-[no-floating-promises/index.ts:8:1]
7 |
8 | returnsPromise().then(() => {});
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9 |
`----

! typescript-eslint(no-floating-promises): Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void`
| operator.
,-[no-floating-promises/index.ts:10:1]
9 |
10 | Promise.reject("value").catch();
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 |
`----

! typescript-eslint(no-floating-promises): Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void`
| operator.
,-[no-floating-promises/index.ts:12:1]
11 |
12 | Promise.reject("value").finally();
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 |
`----

! typescript-eslint(no-floating-promises): An array of Promises may be unintentional. Consider handling the promises' fulfillment or rejection with Promise.all or similar, or explicitly marking
| the expression as ignored with the `void` operator.
,-[no-floating-promises/index.ts:14:1]
13 |
14 | [1, 2, 3].map(async (x) => x + 1);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----

! typescript-eslint(no-floating-promises): Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void`
| operator.
,-[no-floating-promises/src/index.ts:2:1]
1 | const promise = new Promise((resolve, _reject) => resolve("value"));
2 | promise;
: ^^^^^^^^
3 |
`----

! typescript-eslint(no-floating-promises): Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void`
| operator.
,-[no-floating-promises/src/index.ts:8:1]
7 |
8 | returnsPromise().then(() => {});
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9 |
`----

! typescript-eslint(no-floating-promises): Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void`
| operator.
,-[no-floating-promises/src/index.ts:10:1]
9 |
10 | Promise.reject("value").catch();
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 |
`----

! typescript-eslint(no-floating-promises): Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void`
| operator.
,-[no-floating-promises/src/index.ts:12:1]
11 |
12 | Promise.reject("value").finally();
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 |
`----

! typescript-eslint(no-floating-promises): An array of Promises may be unintentional. Consider handling the promises' fulfillment or rejection with Promise.all or similar, or explicitly marking
| the expression as ignored with the `void` operator.
,-[no-floating-promises/src/index.ts:14:1]
13 |
14 | [1, 2, 3].map(async (x) => x + 1);
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----

! typescript-eslint(no-floating-promises): Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void`
| operator.
,-[no-floating-promises/src/overrides.ts:4:1]
3 | }
4 | returnsPromise().then(() => {});
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----

x ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html\eslint(no-debugger)]8;;\: `debugger` statement is not allowed
,-[non-tsgolint.ts:1:1]
1 | debugger;
: ^^^^^^^^^
`----
help: Remove the debugger statement

Found 11 warnings and 1 error.
Finished in <variable>ms on 4 files with 1 rules using 1 threads.
----------
CLI result: LintFoundErrors
----------
Loading