mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 12:51:57 +00:00
chore(linter) convert catch error name to a warning (#1700)
This commit is contained in:
parent
c61ea76b73
commit
f4f0bdf74a
2 changed files with 16 additions and 15 deletions
|
|
@ -14,6 +14,7 @@ use crate::{context::LintContext, rule::Rule, AstNode};
|
|||
|
||||
#[derive(Debug, Error, Diagnostic)]
|
||||
#[error("eslint-plugin-unicorn(catch-error-name): The catch parameter {0:?} should be named {1:?}")]
|
||||
#[diagnostic(severity(warning))]
|
||||
struct CatchErrorNameDiagnostic(Atom, Atom, #[label] pub Span);
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -2,91 +2,91 @@
|
|||
source: crates/oxc_linter/src/tester.rs
|
||||
expression: catch_error_name
|
||||
---
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "descriptiveError" should be named "exception"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "descriptiveError" should be named "exception"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ try { } catch (descriptiveError) { }
|
||||
· ────────────────
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "e" should be named "has_space_after "
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "e" should be named "has_space_after "
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ try { } catch (e) { }
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "e" should be named "1_start_with_a_number"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "e" should be named "1_start_with_a_number"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ try { } catch (e) { }
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "e" should be named "_){ } evilCode; if(false"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "e" should be named "_){ } evilCode; if(false"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ try { } catch (e) { }
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "notMatching" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "notMatching" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ try { } catch (notMatching) { }
|
||||
· ───────────
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "notMatching" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "notMatching" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ try { } catch (notMatching) { }
|
||||
· ───────────
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "notMatching" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "notMatching" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ try { } catch (notMatching) { }
|
||||
· ───────────
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "_" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "_" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ try { } catch (_) { console.log(_) }
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "notMatching" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "notMatching" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ promise.catch(notMatching => { })
|
||||
· ───────────
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ promise.catch((foo) => { })
|
||||
· ───
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ promise.catch(function (foo) { })
|
||||
· ───
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ promise.catch((function (foo) { }))
|
||||
· ───
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ promise.then(function (foo) { }).catch((foo) => { })
|
||||
· ───
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ promise.then(undefined, function (foo) { })
|
||||
· ───
|
||||
╰────
|
||||
|
||||
× eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
⚠ eslint-plugin-unicorn(catch-error-name): The catch parameter "foo" should be named "error"
|
||||
╭─[catch_error_name.tsx:1:1]
|
||||
1 │ promise.then(undefined, (foo) => { })
|
||||
· ───
|
||||
|
|
|
|||
Loading…
Reference in a new issue