chore(linter): update snapshots

This commit is contained in:
Boshen 2023-05-31 16:41:50 +08:00
parent 6ef839b781
commit 591bee2ba1
No known key found for this signature in database
GPG key ID: A69211CB52CC6548
34 changed files with 34 additions and 40 deletions

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: array_callback_return
---
⚠ eslint(array-callback-return): Missing return on some path for array method "Array.form"
╭─[array_callback_return.tsx:1:1]
1 │ Array.from(x, function() {})
@ -793,3 +792,4 @@ expression: array_callback_return
╰────
help: Array method "Array.prototype.filter" needs to have valid return on all code paths

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: bad_array_method_on_arguments
---
⚠ Bad array method on arguments
╭─[bad_array_method_on_arguments.tsx:1:1]
1 │ function fn() {arguments['map'](() => {})}
@ -234,3 +233,4 @@ expression: bad_array_method_on_arguments
╰────
help: The 'arguments' object does not have '@@iterator()' method. If an array method was intended, consider converting the 'arguments' object to an array or using ES6 rest parameter instead.

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: bad_bitwise_operator
---
⚠ Bad bitwise operator
╭─[bad_bitwise_operator.tsx:1:1]
1 │ var a = obj & obj.a
@ -108,3 +107,4 @@ expression: bad_bitwise_operator
╰────
help: Bitwise operator '|=' seems unintended. Consider using non-compound assignment and logical operator '||' instead.

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: bad_comparison_sequence
---
⚠ Bad comparison sequence
╭─[bad_comparison_sequence.tsx:1:1]
1 │ if (a == b == c) { console.log('foo') }
@ -291,3 +290,4 @@ expression: bad_comparison_sequence
help: Comparison result should not be used directly as an operand of another comparison. If you need to compare three or more operands, you should connect each comparison operation with logical
AND operator (`&&`)

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: constructor_super
---
⚠ eslint(constructor-super): Expected to call 'super()'.
╭─[constructor_super.tsx:1:1]
1 │ class A extends B { constructor() {} }
@ -44,3 +43,4 @@ expression: constructor_super
╰────
help: Do not call 'super()' from constructor.

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: eq_eq_eq
---
⚠ eslint(eqeqeq): Expected === and instead saw ==
╭─[eq_eq_eq.tsx:1:1]
1 │ a == b
@ -31,3 +30,4 @@ expression: eq_eq_eq
╰────
help: Prefer strict === operator

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: for_direction
---
⚠ eslint(for-direction): The update clause in this loop moves the variable in the wrong direction
╭─[for_direction.tsx:1:1]
1 │ for (var i = 0; i < 10; i--){}
@ -111,3 +110,4 @@ expression: for_direction
╰────
help: Use while loop for intended infinite loop

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: isolated_declaration
---
⚠ isolated-declaration: Requires type annotation on export parameters
╭─[isolated_declaration.tsx:1:1]
1 │ export function foo(a) { return a; }
@ -57,3 +56,4 @@ expression: isolated_declaration
· ───
╰────

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_array_constructor
---
⚠ eslint(no-array-constructor): Disallow `Array` constructors
╭─[no_array_constructor.tsx:1:1]
1 │ new Array()
@ -52,3 +51,4 @@ expression: no_array_constructor
╰────
help: Use array literal instead

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_async_promise_executor
---
⚠ eslint(no-async-promise-executor): Promise executor functions should not be `async`.
╭─[no_async_promise_executor.tsx:1:1]
1 │ new Promise(async function foo(resolve, reject) {})
@ -21,3 +20,4 @@ expression: no_async_promise_executor
· ─────
╰────

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_bitwise
---
⚠ eslint(no-bitwise): Unexpected use of "^"
╭─[no_bitwise.tsx:1:1]
1 │ a ^ b
@ -94,3 +93,4 @@ expression: no_bitwise
╰────
help: bitwise operators are not allowed, maybe you mistyped `&&` or `||`

View file

@ -1,9 +1,7 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 53
expression: no_caller
---
⚠ eslint(no-caller): Disallow the use of arguments.caller or arguments.callee
╭─[no_caller.tsx:1:1]
1 │ var x = arguments.callee
@ -18,3 +16,4 @@ expression: no_caller
╰────
help: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them

View file

@ -1,9 +1,7 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 67
expression: no_class_assign
---
⚠ eslint(no-class-assign): Unexpected re-assignment of class A
╭─[no_class_assign.tsx:1:1]
1 │ class A { } A = 0;
@ -76,3 +74,4 @@ expression: no_class_assign
· ╰── A is declared as class here
╰────

View file

@ -1,9 +1,7 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 53
expression: no_compare_neg_zero
---
⚠ eslint(no-compare-neg-zero): Do not use the === operator to compare against -0.
╭─[no_compare_neg_zero.tsx:1:1]
1 │ x === -0
@ -95,3 +93,4 @@ expression: no_compare_neg_zero
╰────
help: Use Object.is(x, -0) to test equality with -0 and use 0 for other cases

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_const_assign
---
⚠ eslint(no-const-assign): Unexpected re-assignment of const variable x
╭─[no_const_assign.tsx:1:1]
1 │ const x = 0; x = 1;
@ -139,3 +138,4 @@ expression: no_const_assign
· ╰── b is declared here as const
╰────

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_constant_binary_expression
---
⚠ eslint(no-constant-binary-expression): Unexpected constant "truthiness" on the left-hand side of a `"&&"` expression
╭─[no_constant_binary_expression.tsx:1:1]
1 │ [] && greeting
@ -1550,3 +1549,4 @@ expression: no_constant_binary_expression
· ╰── This expression always evaluates to the constant on the left-hand side
╰────

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_constant_condition
---
⚠ eslint(no-constant-condition): Unexpected constant condition
╭─[no_constant_condition.tsx:1:1]
1 │ if(-2);
@ -773,3 +772,4 @@ expression: no_constant_condition
╰────
help: Constant expression as a test condition is not allowed

View file

@ -2,10 +2,10 @@
source: crates/oxc_linter/src/tester.rs
expression: no_debugger
---
⚠ eslint(no-debugger): `debugger` statement is not allowed
╭─[no_debugger.tsx:1:1]
1 │ if (foo) debugger
· ────────
╰────

View file

@ -1,9 +1,7 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 53
expression: no_dupe_class_members
---
⚠ eslint(no-dupe-class-members): Duplicate class member: "foo"
╭─[no_dupe_class_members.tsx:1:1]
1 │ class A { foo() {} foo() {} }
@ -287,3 +285,4 @@ expression: no_dupe_class_members
╰────
help: The last declaration overwrites previous ones, remove one of them or rename if both should be retained

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_dupe_keys
---
⚠ eslint(no-dupe_keys): Disallow duplicate keys in object literals
╭─[no_dupe_keys.tsx:1:1]
1 │ var x = { a: b, ['a']: b };
@ -119,3 +118,4 @@ expression: no_dupe_keys
╰────
help: Consider removing the duplicated key

View file

@ -1,9 +1,7 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 53
expression: no_duplicate_case
---
⚠ eslint(no-duplicate-case): Disallow duplicate case labels
╭─[no_duplicate_case.tsx:1:1]
1 │ var a = 1; switch (a) {case 1: break; case 1: break; case 2: break; default: break;}
@ -148,3 +146,4 @@ expression: no_duplicate_case
╰────
help: Remove the duplicated case

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_empty
---
⚠ eslint(no-empty): Disallow empty block statements
╭─[no_empty.tsx:1:1]
1 │ try {} catch (ex) {throw ex}
@ -115,3 +114,4 @@ expression: no_empty
╰────
help: Add comment inside empty block statement

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_empty_pattern
---
⚠ eslint(no-empty-pattern): Disallow empty destructuring patterns
╭─[no_empty_pattern.tsx:1:1]
1 │ var {} = foo
@ -66,3 +65,4 @@ expression: no_empty_pattern
· ╰── Empty array binding pattern
╰────

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_function_assign
---
⚠ eslint(no-function-assign): 'foo' is a function.
╭─[no_function_assign.tsx:1:1]
1 │ function foo() {}; foo = bar;
@ -59,3 +58,4 @@ expression: no_function_assign
· ╰── foo is re-assigned here
╰────

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_mixed_operators
---
⚠ eslint(no-mixed-operators): Unexpected mix of && with ||
╭─[no_mixed_operators.tsx:1:1]
1 │ a && b || c
@ -115,3 +114,4 @@ expression: no_mixed_operators
╰────
help: Use parentheses to clarify the intended order of operations.

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_new_symbol
---
⚠ eslint(no-new-symbol): Disallow new operators with the Symbol object
╭─[no_new_symbol.tsx:1:1]
1 │ var foo = new Symbol('foo');
@ -17,3 +16,4 @@ expression: no_new_symbol
╰────
help: Symbol is not intended to be used with the new operator, but to be called as a function. Consider removing the new operator.

View file

@ -1,9 +1,7 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 53
expression: no_self_compare
---
⚠ eslint(no-self-compare): Disallow comparisons where both sides are exactly the same
╭─[no_self_compare.tsx:1:1]
1 │ if (x === x) { }
@ -109,3 +107,4 @@ expression: no_self_compare
╰────
help: If you are testing for NaN, you can use Number.isNaN function.

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_shadow_restricted_names
---
⚠ eslint(no-shadow-restricted-names): Shadowing of global property 'NaN'
╭─[no_shadow_restricted_names.tsx:1:1]
1 │ function NaN(NaN) { var NaN; !function NaN(NaN) { try {} catch(NaN) {} }; }
@ -192,3 +191,4 @@ expression: no_shadow_restricted_names
· ╰── Shadowing of global property 'undefined'
╰────

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_unsafe_negation
---
⚠ Unexpected logical not in the left hand side of 'in' operator
╭─[no_unsafe_negation.tsx:1:1]
1 │ !a in b
@ -80,3 +79,4 @@ expression: no_unsafe_negation
╰────
help: use parenthesis to express the negation of the whole boolean expression, as '!' binds more closely than '<='

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_unused_labels
---
⚠ eslint(no-unused-labels): Disallow unused labels
╭─[no_unused_labels.tsx:1:1]
1 │ A: var foo = 0;
@ -66,3 +65,4 @@ expression: no_unused_labels
╰────
help: 'A:' is defined but never used.

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: uninvoked_array_callback
---
⚠ Uninvoked array callback
╭─[uninvoked_array_callback.tsx:1:1]
1 │ const list = new Array(5).map(_ => {})
@ -30,3 +29,4 @@ expression: uninvoked_array_callback
╰────
help: consider filling the array with `undefined` values using `Array.prototype.fill()`

View file

@ -1,9 +1,7 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 53
expression: use_isnan
---
⚠ eslint(use-isnan): Requires calls to isNaN() when checking for NaN
╭─[use_isnan.tsx:1:1]
1 │ 123 == NaN;
@ -606,3 +604,4 @@ expression: use_isnan
╰────
help: Array prototype method 'indexOf' cannot find NaN.

View file

@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: valid_typeof
---
⚠ eslint(valid-typeof): Invalid typeof comparison value.
╭─[valid_typeof.tsx:1:1]
1 │ typeof foo === 'strnig'
@ -133,3 +132,4 @@ expression: valid_typeof
· ───────────
╰────

View file

@ -97,6 +97,7 @@ impl Tester {
source_text.to_string(),
));
handler.render_report(&mut self.snapshot, diagnostic.as_ref()).unwrap();
self.snapshot.push('\n');
}
false
}