-
-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finished adding implementation of promise/prefer-catch
- Loading branch information
1 parent
827ab6f
commit 822a56b
Showing
2 changed files
with
61 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
source: crates/oxc_linter/src/tester.rs | ||
--- | ||
⚠ eslint-plugin-promise(prefer-catch): Prefer `catch` to `then(a, b)` or `then(null, b)` | ||
╭─[prefer_catch.tsx:1:1] | ||
1 │ prom.then(fn1, fn2) | ||
· ─────────────────── | ||
╰──── | ||
help: Handle promise errors in a `.catch` instead of using the second argument of `then`. | ||
|
||
⚠ eslint-plugin-promise(prefer-catch): Prefer `catch` to `then(a, b)` or `then(null, b)` | ||
╭─[prefer_catch.tsx:1:1] | ||
1 │ prom.then(fn1, (fn2)) | ||
· ───────────────────── | ||
╰──── | ||
help: Handle promise errors in a `.catch` instead of using the second argument of `then`. | ||
|
||
⚠ eslint-plugin-promise(prefer-catch): Prefer `catch` to `then(a, b)` or `then(null, b)` | ||
╭─[prefer_catch.tsx:1:1] | ||
1 │ prom.then(null, fn2) | ||
· ──────────────────── | ||
╰──── | ||
help: Handle promise errors in a `.catch` instead of using the second argument of `then`. | ||
|
||
⚠ eslint-plugin-promise(prefer-catch): Prefer `catch` to `then(a, b)` or `then(null, b)` | ||
╭─[prefer_catch.tsx:1:1] | ||
1 │ prom.then(undefined, fn2) | ||
· ───────────────────────── | ||
╰──── | ||
help: Handle promise errors in a `.catch` instead of using the second argument of `then`. | ||
|
||
⚠ eslint-plugin-promise(prefer-catch): Prefer `catch` to `then(a, b)` or `then(null, b)` | ||
╭─[prefer_catch.tsx:1:18] | ||
1 │ function foo() { prom.then(x => {}, () => {}) } | ||
· ──────────────────────────── | ||
╰──── | ||
help: Handle promise errors in a `.catch` instead of using the second argument of `then`. | ||
|
||
⚠ eslint-plugin-promise(prefer-catch): Prefer `catch` to `then(a, b)` or `then(null, b)` | ||
╭─[prefer_catch.tsx:2:9] | ||
1 │ function foo() { | ||
2 │ prom.then(function a() { }, function b() {}).then(fn1, fn2) | ||
· ─────────────────────────────────────────────────────────── | ||
3 │ } | ||
╰──── | ||
help: Handle promise errors in a `.catch` instead of using the second argument of `then`. |