Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linter/eslint): drop quotes around max-params lint warning #4608

Merged
merged 1 commit into from
Aug 2, 2024
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
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/eslint/max_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde_json::Value;
use crate::{context::LintContext, rule::Rule, AstNode};

fn max_params_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic {
OxcDiagnostic::warn(format!("{x0:?}"))
OxcDiagnostic::warn(x0.to_string())
.with_help(
"This rule enforces a maximum number of parameters allowed in function definitions.",
)
Expand Down
20 changes: 10 additions & 10 deletions crates/oxc_linter/src/snapshots/max_params.snap
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
---
source: crates/oxc_linter/src/tester.rs
---
⚠ eslint(max-params): "Function 'test' has too many parameters (3). Maximum allowed is 2."
⚠ eslint(max-params): Function 'test' has too many parameters (3). Maximum allowed is 2.
╭─[max_params.tsx:1:14]
1 │ function test(a, b, c) {}
· ─────────
╰────
help: This rule enforces a maximum number of parameters allowed in function definitions.

⚠ eslint(max-params): "Function 'test' has too many parameters (4). Maximum allowed is 3."
⚠ eslint(max-params): Function 'test' has too many parameters (4). Maximum allowed is 3.
╭─[max_params.tsx:1:14]
1 │ function test(a, b, c, d) {}
· ────────────
╰────
help: This rule enforces a maximum number of parameters allowed in function definitions.

⚠ eslint(max-params): "Function has too many parameters (4). Maximum allowed is 3."
⚠ eslint(max-params): Function has too many parameters (4). Maximum allowed is 3.
╭─[max_params.tsx:1:20]
1 │ var test = function(a, b, c, d) {};
· ────────────
╰────
help: This rule enforces a maximum number of parameters allowed in function definitions.

⚠ eslint(max-params): "Arrow function has too many parameters (4). Maximum allowed is 3."
⚠ eslint(max-params): Arrow function has too many parameters (4). Maximum allowed is 3.
╭─[max_params.tsx:1:12]
1 │ var test = (a, b, c, d) => {};
· ────────────
╰────
help: This rule enforces a maximum number of parameters allowed in function definitions.

⚠ eslint(max-params): "Function has too many parameters (4). Maximum allowed is 3."
⚠ eslint(max-params): Function has too many parameters (4). Maximum allowed is 3.
╭─[max_params.tsx:1:10]
1 │ (function(a, b, c, d) {});
· ────────────
╰────
help: This rule enforces a maximum number of parameters allowed in function definitions.

⚠ eslint(max-params): "Function 'test' has too many parameters (3). Maximum allowed is 1."
⚠ eslint(max-params): Function 'test' has too many parameters (3). Maximum allowed is 1.
╭─[max_params.tsx:1:25]
1 │ var test = function test(a, b, c) {};
· ─────────
╰────
help: This rule enforces a maximum number of parameters allowed in function definitions.

⚠ eslint(max-params): "Function 'test' has too many parameters (3). Maximum allowed is 2."
⚠ eslint(max-params): Function 'test' has too many parameters (3). Maximum allowed is 2.
╭─[max_params.tsx:1:14]
1 │ function test(a, b, c) {}
· ─────────
╰────
help: This rule enforces a maximum number of parameters allowed in function definitions.

⚠ eslint(max-params): "Function 'test' has too many parameters (4). Maximum allowed is 3."
⚠ eslint(max-params): Function 'test' has too many parameters (4). Maximum allowed is 3.
╭─[max_params.tsx:1:14]
1 │ function test(a, b, c, d) {}
· ────────────
╰────
help: This rule enforces a maximum number of parameters allowed in function definitions.

⚠ eslint(max-params): "Function 'test' has too many parameters (1). Maximum allowed is 0."
⚠ eslint(max-params): Function 'test' has too many parameters (1). Maximum allowed is 0.
╭─[max_params.tsx:1:14]
1 │ function test(a) {}
· ───
╰────
help: This rule enforces a maximum number of parameters allowed in function definitions.

⚠ eslint(max-params): "Function 'test' has too many parameters (3). Maximum allowed is 2."
⚠ eslint(max-params): Function 'test' has too many parameters (3). Maximum allowed is 2.
╭─[max_params.tsx:1:14]
1 │ function test(a, b, c) {
· ─────────
Expand Down