feat(linter): handle cjs module.exports.foo = bar and exports.foo = bar (#2492)

This commit is contained in:
Boshen authored and GitHub committed 2024-02-24 23:54:43 +08:00
1 parent d0a9c465f7
commit f64c7e04a3
291 files changed
+65 -647

No files matched your search

Generated
+2 -2
View File
@@ -809,9 +809,9 @@ dependencies = [
[[package]]
name = "insta"
version = "1.34.0"
version = "1.35.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc"
checksum = "7c985c1bef99cf13c58fade470483d81a2bfe846ebde60ed28cc2dddec2df9e2"
dependencies = [
"console",
"globset",
+1 -1
View File
@@ -128,7 +128,7 @@ static_assertions = { version = "1.1.0" }
stacker = { version = "0.1.15" }
tracing = { version = "0.1" }
tracing-subscriber = { version = "0.3" }
insta = { version = "1.34.0", features = ["glob"] }
insta = { version = "1.35.1", features = ["glob"] }
codspeed-criterion-compat = { version = "2.3.3", default-features = false }
glob = { version = "0.3.1" }
mime_guess = { version = "2.0.4" }
+1 -1
View File
@@ -645,7 +645,7 @@ impl<'a> MemberExpression<'a> {
}
}
pub fn static_property_info(&'a self) -> Option<(Span, &'a str)> {
pub fn static_property_info(&self) -> Option<(Span, &str)> {
match self {
MemberExpression::ComputedMemberExpression(expr) => match &expr.expression {
Expression::StringLiteral(lit) => Some((lit.span, &lit.value)),
@@ -0,0 +1,2 @@
module.exports.foo = 1;
exports.bar = 1;
@@ -3,7 +3,7 @@ use oxc_diagnostics::{
thiserror::Error,
};
use oxc_macros::declare_oxc_lint;
use oxc_span::{Atom, Span};
use oxc_span::Span;
use oxc_syntax::module_record::ImportImportName;
use crate::{context::LintContext, rule::Rule};
@@ -11,7 +11,7 @@ use crate::{context::LintContext, rule::Rule};
#[derive(Debug, Error, Diagnostic)]
#[error("eslint-plugin-import(default): No default export found in imported module {0:?}")]
#[diagnostic(severity(warning), help("does {0:?} have the default export?"))]
struct DefaultDiagnostic(Atom, #[label] pub Span);
struct DefaultDiagnostic(String, #[label] pub Span);
/// <https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/default.md>
#[derive(Debug, Default, Clone)]
@@ -50,7 +50,7 @@ impl Rule for Default {
&& !remote_module_record_ref.exported_bindings.contains_key("default")
{
ctx.diagnostic(DefaultDiagnostic(
specifier.clone(),
specifier.to_string(),
import_entry.module_request.span(),
));
}
+10 -6
View File
@@ -3,7 +3,7 @@ use oxc_diagnostics::{
thiserror::Error,
};
use oxc_macros::declare_oxc_lint;
use oxc_span::{Atom, Span};
use oxc_span::Span;
use oxc_syntax::module_record::{ExportImportName, ImportImportName};
use crate::{context::LintContext, rule::Rule};
@@ -11,7 +11,7 @@ use crate::{context::LintContext, rule::Rule};
#[derive(Debug, Error, Diagnostic)]
#[error("eslint-plugin-import(named): named import {0:?} not found")]
#[diagnostic(severity(warning), help("does {1:?} have the export {0:?}?"))]
struct NamedDiagnostic(Atom, Atom, #[label] pub Span);
struct NamedDiagnostic(String, String, #[label] pub Span);
/// <https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/named.md>
#[derive(Debug, Default, Clone)]
@@ -56,8 +56,8 @@ impl Rule for Named {
continue;
}
ctx.diagnostic(NamedDiagnostic(
import_name.name().clone(),
specifier.clone(),
import_name.name().to_string(),
specifier.to_string(),
import_name.span(),
));
}
@@ -80,8 +80,8 @@ impl Rule for Named {
continue;
}
ctx.diagnostic(NamedDiagnostic(
import_name.name().clone(),
specifier.clone(),
import_name.name().to_string(),
specifier.to_string(),
import_name.span(),
));
}
@@ -164,6 +164,8 @@ fn test() {
// "import { foo } from './export-all'",
// TypeScript export assignment
"import x from './typescript-export-assign-object'",
// oxc
"import { foo, bar } from './oxc_named'",
];
let fail = vec![
@@ -198,6 +200,8 @@ fn test() {
// Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.
"import { NotExported } from './typescript-export-assign-object'",
"import { FooBar } from './typescript-export-assign-object'",
// oxc
"import { baz, quaz } from './oxc_named'",
];
Tester::new(Named::NAME, pass, fail)
+1 -1
View File
@@ -143,7 +143,7 @@ impl Runtime {
.map(|p| TsconfigOptions { config_file: p, references: TsconfigReferences::Auto });
Resolver::new(ResolveOptions {
extensions: VALID_EXTENSIONS.iter().map(|ext| format!(".{ext}")).collect(),
condition_names: vec!["require".into(), "module".into()],
condition_names: vec!["module".into(), "require".into()],
tsconfig,
..ResolveOptions::default()
})
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: adjacent_overload_signatures
---
⚠ typescript-eslint(adjacent-overload-signatures): All "foo" signatures should be adjacent.
╭─[adjacent_overload_signatures.tsx:3:18]
2 │ function foo(s: string);
@@ -369,4 +368,3 @@ expression: adjacent_overload_signatures
· ──────────
6 │ }
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: alt_text
---
⚠ eslint-plugin-jsx-a11y(alt-text): Missing `alt` attribute.
╭─[alt_text.tsx:1:1]
1 │ <img />;
@@ -450,4 +449,3 @@ expression: alt_text
· ──────────────────────
╰────
help: <input> elements with type="image" must have a text alternative through the `alt`, `aria-label`, or `aria-labelledby` prop.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: anchor_has_content
---
⚠ eslint-plugin-jsx-a11y(anchor-has-content): Missing accessible content when using `a` elements.
╭─[anchor_has_content.tsx:1:1]
1 │ <a />
@@ -30,4 +29,3 @@ expression: anchor_has_content
· ────────
╰────
help: Provide screen reader accessible content when using `a` elements.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: anchor_is_valid
---
⚠ eslint-plugin-jsx-a11y(anchor-is-valid): Missing `href` attribute for the `a` element.
╭─[anchor_is_valid.tsx:1:2]
1 │ <a />
@@ -92,4 +91,3 @@ expression: anchor_is_valid
· ────
╰────
help: Use a `button` element instead of an `a` element.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: approx_constant
---
⚠ oxc(approx-constant): Approximate value of `PI` found.
╭─[approx_constant.tsx:1:29]
1 │ const getArea = (radius) => 3.141 * radius * radius;
@@ -65,4 +64,3 @@ expression: approx_constant
· ────────
╰────
help: Use `Math.SQRT2` instead
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: aria_activedescendant_has_tabindex
---
⚠ eslint-plugin-jsx-a11y(aria-activedescendant-has-tabindex): Enforce elements with aria-activedescendant are tabbable.
╭─[aria_activedescendant_has_tabindex.tsx:1:2]
1 │ <div aria-activedescendant={someID} />;
@@ -16,4 +15,3 @@ expression: aria_activedescendant_has_tabindex
· ───────────────
╰────
help: An element that manages focus with `aria-activedescendant` must have a tabindex.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: aria_props
---
⚠ eslint-plugin-jsx-a11y(aria-props): Invalid ARIA prop.
╭─[aria_props.tsx:1:6]
1 │ <div aria-="foobar" />
@@ -23,4 +22,3 @@ expression: aria_props
· ───────────────────────────────
╰────
help: `aria-skldjfaria-klajsd` is an invalid ARIA attribute.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: aria_role
---
⚠ eslint-plugin-jsx-a11y(aria-role): Elements with ARIA roles must use a valid, non-abstract ARIA role.
╭─[aria_role.tsx:1:11]
1 │ <div role='foobar' />
@@ -113,4 +112,3 @@ expression: aria_role
· ────────
╰────
help: Set a valid, non-abstract ARIA role for element with ARIA, `Button` is an invalid aria role
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: aria_unsupported_elements
---
⚠ eslint-plugin-jsx-a11y(aria-unsupported-elements): This element does not support ARIA roles, states and properties.
╭─[aria_unsupported_elements.tsx:1:7]
1 │ <base role {...props} />
@@ -226,4 +225,3 @@ expression: aria_unsupported_elements
· ───────────
╰────
help: Try removing the prop `aria-hidden`.
@@ -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.from"
╭─[array_callback_return.tsx:1:26]
1 │ Array.from(x, function() {})
@@ -792,4 +791,3 @@ expression: array_callback_return
· ────────────────────────
╰────
help: Array method "Array.prototype.filter" needs to have valid return on all code paths
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: array_type
---
⚠ typescript-eslint(array-type): Array type using 'Array<number>' is forbidden. Use 'number[]' instead.
╭─[array_type.tsx:1:8]
1 │ let a: Array<number> = [];
@@ -565,4 +564,3 @@ expression: array_type
1 │ const foo: ReadonlyArray<new (...args: any[]) => void> = [];
· ───────────────────────────────────────────
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: autocomplete_valid
---
⚠ eslint-plugin-jsx-a11y(autocomplete-valid): `foo` is not a valid value for autocomplete.
╭─[autocomplete_valid.tsx:1:20]
1 │ <input type='text' autocomplete='foo' />;
@@ -44,4 +43,3 @@ expression: autocomplete_valid
· ──────────────────
╰────
help: Change `baz` to a valid value for autocomplete.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: bad_array_method_on_arguments
---
⚠ deepscan(bad-array-method-on-arguments): Bad array method on arguments
╭─[bad_array_method_on_arguments.tsx:1:16]
1 │ function fn() {arguments['map'](() => {})}
@@ -233,4 +232,3 @@ 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.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: bad_bitwise_operator
---
⚠ deepscan(bad-bitwise-operator): Bad bitwise operator
╭─[bad_bitwise_operator.tsx:1:9]
1 │ var a = obj & obj.a
@@ -107,4 +106,3 @@ expression: bad_bitwise_operator
· ──────────────────
╰────
help: Bitwise operator '|=' seems unintended. Consider using non-compound assignment and logical operator '||' instead.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: bad_char_at_comparison
---
⚠ deepscan(bad-char-at-comparison): Invalid comparison with `charAt` method
╭─[bad_char_at_comparison.tsx:1:1]
1 │ a.charAt(4) === 'aa'
@@ -56,4 +55,3 @@ expression: bad_char_at_comparison
· ╰── `charAt` called here
╰────
help: `String.prototype.charAt` returns a string of length 1. If the return value is compared with a string of length greater than 1, the comparison will always be false.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: bad_comparison_sequence
---
⚠ deepscan(bad-comparison-sequence): Bad comparison sequence
╭─[bad_comparison_sequence.tsx:1:5]
1 │ if (a == b == c) { console.log('foo') }
@@ -254,4 +253,3 @@ 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 (`&&`)
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: bad_min_max_func
---
⚠ deepscan(bad-min-max-func): Math.min and Math.max combination leads to constant result
╭─[bad_min_max_func.tsx:1:1]
1 │ Math.min(Math.max(100, x), 0)
@@ -58,4 +57,3 @@ expression: bad_min_max_func
· ──────────────────────────────────
╰────
help: This evaluates to 155.0 because of the incorrect `Math.min`/`Math.max` combination
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: bad_object_literal_comparison
---
⚠ deepscan(bad-object-literal-comparison): Unexpected object literal comparison.
╭─[bad_object_literal_comparison.tsx:1:5]
1 │ if (y === {}) { }
@@ -72,4 +71,3 @@ expression: bad_object_literal_comparison
· ────────────
╰────
help: This comparison will always return true as array literals are never equal to each other. Consider using `Array.length` if empty checking was intended.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: bad_replace_all_arg
---
⚠ deepscan(bad-replace-all-arg): Global flag (g) is missing in the regular expression supplied to the `replaceAll` method.
╭─[bad_replace_all_arg.tsx:1:12]
1 │ withSpaces.replaceAll(/\s+/, ',');
@@ -80,4 +79,3 @@ expression: bad_replace_all_arg
5 │
╰────
help: To replace all occurrences of a string, use the `replaceAll` method with the global flag (g) in the regular expression.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: ban_ts_comment
---
⚠ typescript-eslint(ban-ts-comment): Do not use @ts-expect-error because it alters compilation errors.
╭─[ban_ts_comment.tsx:1:3]
1 │ // @ts-expect-error
@@ -286,4 +285,3 @@ expression: ban_ts_comment
1 │ // @ts-check: TS1234
· ──────────────────
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: ban_tslint_comment
---
⚠ typescript-eslint(ban-tslint-comment): tslint comment detected: "tslint:disable"
╭─[ban_tslint_comment.tsx:1:1]
1 │ /* tslint:disable */
@@ -53,4 +52,3 @@ expression: ban_tslint_comment
3 │ console.log(woah);
4 │
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: ban_types
---
⚠ typescript-eslint(ban-types): Do not use "String" as a type. Use "string" instead
╭─[ban_types.tsx:1:8]
1 │ let a: String;
@@ -234,4 +233,3 @@ expression: ban_types
4 │ }
╰────
help: The `Function` type accepts any function-like value
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: button_has_type
---
⚠ eslint-plugin-react(button-has-type): `button` elements must have an explicit `type` attribute.
╭─[button_has_type.tsx:1:2]
1 │ <button/>
@@ -198,4 +197,3 @@ expression: button_has_type
· ─────────────
╰────
help: Change the `type` attribute to one of the allowed values: `button`, `submit`, or `reset`.
@@ -2,7 +2,6 @@
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"
╭─[catch_error_name.tsx:1:16]
1 │ try { } catch (descriptiveError) { }
@@ -92,4 +91,3 @@ expression: catch_error_name
1 │ promise.then(undefined, (foo) => { })
· ───
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: click_events_have_key_events
---
⚠ eslint-plugin-jsx-a11y(click-events-have-key-events): Enforce a clickable non-interactive element has at least one keyboard event listener.
╭─[click_events_have_key_events.tsx:1:1]
1 │ <div onClick={() => void 0} />;
@@ -86,4 +85,3 @@ expression: click_events_have_key_events
· ──────────────────────────
╰────
help: Visible, non-interactive elements with click handlers must have one of keyup, keydown, or keypress listener.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: const_comparisons
---
⚠ oxc(const-comparisons): Unexpected constant comparison
╭─[const_comparisons.tsx:1:1]
1 │ status_code <= 400 && status_code > 500;
@@ -236,4 +235,3 @@ expression: const_comparisons
· ╰── This will always evaluate to true.
╰────
help: if `status_code < 500` evaluates to true, `status_code <= 500` will always evaluate to true as well
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: default
---
⚠ eslint-plugin-import(default): No default export found in imported module "./named-exports"
╭─[index.js:1:17]
1 │ import baz from "./named-exports"
@@ -41,4 +40,3 @@ expression: default
· ──────────────
╰────
help: does "./typescript" have the default export?
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: default_case_last
---
⚠ eslint(default-case-last): Enforce default clauses in switch statements to be last
╭─[default_case_last.tsx:1:16]
1 │ switch (foo) { default: bar(); break; case 1: baz(); break; }
@@ -100,4 +99,3 @@ expression: default_case_last
· ───┬───
· ╰── Default clause should be the last clause.
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: double_comparisons
---
⚠ oxc(double-comparisons): Unexpected double comparisons.
╭─[double_comparisons.tsx:1:1]
1 │ x == y || x < y
@@ -86,4 +85,3 @@ expression: double_comparisons
· ────────────────
╰────
help: This logical expression can be simplified. Try using the `>=` operator instead.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: empty_brace_spaces
---
⚠ eslint-plugin-unicorn(empty-brace-spaces): No spaces inside empty pair of braces allowed
╭─[empty_brace_spaces.tsx:1:1]
1 │ { }
@@ -916,4 +915,3 @@ expression: empty_brace_spaces
· ───────
╰────
help: There should be no spaces or new lines inside a pair of empty braces as it affects the overall readability of the code.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: eqeqeq
---
⚠ eslint(eqeqeq): Expected > and instead saw >=
╭─[eqeqeq.tsx:1:1]
1 │ null >= 1
@@ -79,4 +78,3 @@ expression: eqeqeq
· ────────────
╰────
help: Prefer === operator
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: erasing_op
---
⚠ oxc(erasing-op): Unexpected erasing operation. This expression will always evaluate to zero.
╭─[erasing_op.tsx:1:1]
1 │ x * 0;
@@ -30,4 +29,3 @@ expression: erasing_op
· ─────
╰────
help: This is most likely not the intended outcome. Consider removing the operation, or directly assigning zero to the variable
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: error_message
---
⚠ eslint-plugin-unicorn(error-message): Pass a message to the Error constructor.
╭─[error_message.tsx:1:7]
1 │ throw new Error()
@@ -128,4 +127,3 @@ expression: error_message
1 │ const error = new AggregateError;
· ──────────────────
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: escape_case
---
⚠ eslint-plugin-unicorn(escape-case): Use uppercase characters for the value of the escape sequence.
╭─[escape_case.tsx:1:13]
1 │ const foo = "\xAab\xaab\xAAb\uAaAab\uaaaab\uAAAAb\u{AaAa}b\u{aaaa}b\u{AAAA}";
@@ -50,4 +49,3 @@ expression: escape_case
1 │ const foo = new RegExp("/\u{1d306}/", "u")
· ─────────────
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: expect_expect
---
⚠ eslint-plugin-jest(expect-expect): Test has no assertions
╭─[expect_expect.tsx:1:1]
1 │ it("should fail", () => {});
@@ -120,4 +119,3 @@ expression: expect_expect
3 │ const asyncFunction = async () => {
╰────
help: Add assertion(s) in this Test
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: explicit_length_check
---
⚠ eslint-plugin-unicorn(explicit-length-check): Use `.length > 0` when checking length is not zero.
╭─[explicit_length_check.tsx:1:11]
1 │ const x = foo.length || bar()
@@ -70,4 +69,3 @@ expression: explicit_length_check
1 │ let foo = arr.length ? 'non-empty' : 'empty'
· ──────────
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: filename_case
---
⚠ eslint-plugin-unicorn(filename-case): Filename should not be in kebab case
╭─[filename_case.tsx:1:1]
1 │ import foo from 'bar'
@@ -14,4 +13,3 @@ expression: filename_case
1 │ baz;
· ▲
╰────
@@ -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:17]
1 │ for (var i = 0; i < 10; i--){}
@@ -155,4 +154,3 @@ expression: for_direction
· ╰── This test moves in the wrong direction
╰────
help: Use while loop for intended infinite loop
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: getter_return
---
⚠ eslint(getter-return): Expected to always return a value in getter.
╭─[getter_return.tsx:1:20]
1 │ var foo = { get bar() {} };
@@ -242,4 +241,3 @@ expression: getter_return
· ─────────────
╰────
help: Return a value from all code paths in getter.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: google_font_display
---
⚠ eslint-plugin-next(google-font-display): A font-display parameter is missing (adding `&display=optional` is recommended).
╭─[google_font_display.tsx:6:25]
5 │ <Head>
@@ -38,4 +37,3 @@ expression: google_font_display
8 │ rel="stylesheet"
╰────
help: See https://nextjs.org/docs/messages/google-font-display
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: google_font_preconnect
---
⚠ eslint-plugin-next(google-font-preconnect): `rel="preconnect"` is missing from Google Font.
╭─[google_font_preconnect.tsx:4:24]
3 │ <div>
@@ -20,4 +19,3 @@ expression: google_font_preconnect
5 │ </div>
╰────
help: See: https://nextjs.org/docs/messages/google-font-preconnect
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: heading_has_content
---
⚠ eslint(heading-has-content): Headings must have content and the content must be accessible by a screen reader.
╭─[heading_has_content.tsx:1:1]
1 │ <h1 />
@@ -65,4 +64,3 @@ expression: heading_has_content
· ───────────
╰────
help: Provide screen reader accessible content when using heading elements.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: html_has_lang
---
⚠ eslint-plugin-jsx-a11y(html-has-lang): Missing lang attribute.
╭─[html_has_lang.tsx:1:2]
1 │ <html />;
@@ -37,4 +36,3 @@ expression: html_has_lang
· ───────
╰────
help: Add a lang attribute to the html element whose value represents the primary language of document.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: iframe_has_title
---
⚠ eslint-plugin-jsx-a11y(iframe-has-title): Missing `title` attribute for the `iframe` element.
╭─[iframe_has_title.tsx:1:2]
1 │ <iframe />
@@ -72,4 +71,3 @@ expression: iframe_has_title
· ────────────
╰────
help: Provide title property for iframe element.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: img_redundant_alt
---
⚠ eslint-plugin-jsx-a11y(img-redundant-alt): Redundant alt attribute.
╭─[img_redundant_alt.tsx:1:6]
1 │ <img alt='Photo of friend.' />;
@@ -170,4 +169,3 @@ expression: img_redundant_alt
· ───
╰────
help: Provide no redundant alt text for image. Screen-readers already announce `img` tags as an image. You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: inline_script_id
---
⚠ eslint-plugin-next(inline-script-id): `next/script` components with inline content must specify an `id` attribute.
╭─[inline_script_id.tsx:5:26]
4 │ return (
@@ -38,4 +37,3 @@ expression: inline_script_id
6 │ dangerouslySetInnerHTML={{
╰────
help: See https://nextjs.org/docs/messages/inline-script-id
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: jsx_key
---
⚠ eslint-plugin-react(jsx-key): Missing "key" prop for element in array.
╭─[jsx_key.tsx:1:3]
1 │ [<App />];
@@ -326,4 +325,3 @@ expression: jsx_key
8 │ <Text foo bar baz qux onClick={() => onClickHandler()} onPointerDown={() => onPointerDownHandler()} onMouseDown={() => onMouseDownHandler()} />
╰────
help: Add a "key" prop to the element in the iterator (https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key).
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: jsx_no_comment_textnodes
---
⚠ eslint-plugin-react(jsx-no-comment-textnodes): Comments inside children section of tag should be placed inside braces
╭─[jsx_no_comment_textnodes.tsx:4:38]
3 │ render() {
@@ -63,4 +62,3 @@ expression: jsx_no_comment_textnodes
· ──
4 │ };
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: jsx_no_duplicate_props
---
⚠ eslint-plugin-react(jsx-no-duplicate-props): No duplicate props allowed. The prop "a" is duplicated.
╭─[jsx_no_duplicate_props.tsx:1:6]
1 │ <App a a />;
@@ -70,4 +69,3 @@ expression: jsx_no_duplicate_props
6 │ b="b"
╰────
help: Remove one of the props, or rename them so each prop is distinct.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: jsx_no_jsx_as_prop
---
⚠ eslint-plugin-react-perf(jsx-no-jsx-as-prop): JSX attribute values should not contain other JSX.
╭─[jsx_no_jsx_as_prop.tsx:1:12]
1 │ <Item jsx={<SubItem />} />
@@ -30,4 +29,3 @@ expression: jsx_no_jsx_as_prop
· ───────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: jsx_no_new_array_as_prop
---
⚠ eslint-plugin-react-perf(jsx-no-new-array-as-prop): JSX attribute values should not contain Arrays created in the same scope.
╭─[jsx_no_new_array_as_prop.tsx:1:13]
1 │ <Item list={[]} />
@@ -44,4 +43,3 @@ expression: jsx_no_new_array_as_prop
· ──
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: jsx_no_new_function_as_prop
---
⚠ eslint-plugin-react-perf(jsx-no-new-function-as-prop): JSX attribute values should not contain functions created in the same scope.
╭─[jsx_no_new_function_as_prop.tsx:1:13]
1 │ <Item prop={function(){return true}} />
@@ -65,4 +64,3 @@ expression: jsx_no_new_function_as_prop
· ────────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
@@ -1,68 +0,0 @@
---
source: crates/oxc_linter/src/tester.rs
expression: jsx_no_new_function_as_props
---
⚠ eslint-plugin-react-perf(jsx-no-new-function-as-props): JSX attribute values should not contain functions created in the same scope.
╭─[jsx_no_new_function_as_props.tsx:1:1]
1 │ <Item prop={function(){return true}} />
· ───────────────────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
⚠ eslint-plugin-react-perf(jsx-no-new-function-as-props): JSX attribute values should not contain functions created in the same scope.
╭─[jsx_no_new_function_as_props.tsx:1:1]
1 │ <Item prop={() => true} />
· ──────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
⚠ eslint-plugin-react-perf(jsx-no-new-function-as-props): JSX attribute values should not contain functions created in the same scope.
╭─[jsx_no_new_function_as_props.tsx:1:1]
1 │ <Item prop={new Function('a', 'alert(a)')}/>
· ─────────────────────────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
⚠ eslint-plugin-react-perf(jsx-no-new-function-as-props): JSX attribute values should not contain functions created in the same scope.
╭─[jsx_no_new_function_as_props.tsx:1:1]
1 │ <Item prop={Function()}/>
· ──────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
⚠ eslint-plugin-react-perf(jsx-no-new-function-as-props): JSX attribute values should not contain functions created in the same scope.
╭─[jsx_no_new_function_as_props.tsx:1:1]
1 │ <Item onClick={this.clickHandler.bind(this)} />
· ────────────────────────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
⚠ eslint-plugin-react-perf(jsx-no-new-function-as-props): JSX attribute values should not contain functions created in the same scope.
╭─[jsx_no_new_function_as_props.tsx:1:1]
1 │ <Item callback={this.props.callback || function() {}} />
· ─────────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
⚠ eslint-plugin-react-perf(jsx-no-new-function-as-props): JSX attribute values should not contain functions created in the same scope.
╭─[jsx_no_new_function_as_props.tsx:1:1]
1 │ <Item callback={this.props.callback ? this.props.callback : function() {}} />
· ─────────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
⚠ eslint-plugin-react-perf(jsx-no-new-function-as-props): JSX attribute values should not contain functions created in the same scope.
╭─[jsx_no_new_function_as_props.tsx:1:1]
1 │ <Item prop={this.props.callback || this.props.callback ? this.props.callback : function(){}} />
· ────────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
⚠ eslint-plugin-react-perf(jsx-no-new-function-as-props): JSX attribute values should not contain functions created in the same scope.
╭─[jsx_no_new_function_as_props.tsx:1:1]
1 │ <Item prop={this.props.callback || (this.props.cb ? this.props.cb : function(){})} />
· ────────────
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: jsx_no_new_object_as_prop
---
⚠ eslint-plugin-react-perf(jsx-no-new-object-as-prop): JSX attribute values should not contain objects created in the same scope.
╭─[jsx_no_new_object_as_prop.tsx:1:15]
1 │ <Item config={{}} />
@@ -51,4 +50,3 @@ expression: jsx_no_new_object_as_prop
· ──
╰────
help: simplify props or memoize props in the parent component (https://react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: jsx_no_target_blank
---
⚠ eslint-plugin-react(jsx-no-target-blank): Using target=`_blank` without rel=`noreferrer` (which implies rel=`noopener`) is a security risk in older browsers: see https://mathiasbynens.github.io/rel-noopener/#recommendations
╭─[jsx_no_target_blank.tsx:1:11]
1 │ <a target="_blank" href="https://example.com/1"></a>
@@ -352,4 +351,3 @@ expression: jsx_no_target_blank
· ───────────
╰────
help: add rel=`noreferrer` to the element
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: jsx_no_undef
---
⚠ eslint-plugin-react(jsx-no-undef): Disallow undeclared variables in JSX
╭─[jsx_no_undef.tsx:1:26]
1 │ var React; React.render(<App />);
@@ -58,4 +57,3 @@ expression: jsx_no_undef
· ───
╰────
help: 'App' is not defined.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: jsx_no_useless_fragment
---
⚠ eslint-plugin-react(jsx-no-useless-fragment): Fragments should contain more than one child.
╭─[jsx_no_useless_fragment.tsx:1:1]
1 │ <></>
@@ -160,4 +159,3 @@ expression: jsx_no_useless_fragment
1 │ <><Foo>{moo}</Foo></>
· ──
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: lang
---
⚠ eslint-plugin-jsx-a11y(lang): Lang attribute must have a valid value.
╭─[lang.tsx:1:7]
1 │ <html lang='foo' />
@@ -37,4 +36,3 @@ expression: lang
· ──────────
╰────
help: Set a valid value for lang attribute.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: max_expects
---
⚠ eslint-plugin-jest(max-expects): Enforces a maximum number assertion calls in a test body.
╭─[max_expects.tsx:8:21]
7 │ expect(true).toBeDefined();
@@ -83,4 +82,3 @@ expression: max_expects
5 │ });
╰────
help: Too many assertion calls (2) - maximum allowed is 1
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: media_has_caption
---
⚠ eslint-plugin-jsx-a11y(media-has-caption): Missing <track> element with captions inside <audio> or <video> element
╭─[media_has_caption.tsx:1:1]
1 │ <audio><track /></audio>
@@ -233,4 +232,3 @@ expression: media_has_caption
· ────────────────────────────────────────────────
╰────
help: Media elements such as <audio> and <video> must have a <track> for captions.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: misrefactored_assign_op
---
⚠ oxc(misrefactored-assign-op): Misrefactored assign op. Variable appears on both sides of an assignment operation
╭─[misrefactored_assign_op.tsx:1:1]
1 │ a += a + 1;
@@ -72,4 +71,3 @@ expression: misrefactored_assign_op
· ──────────
╰────
help: Did you mean `a *= a`?
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: missing_throw
---
⚠ deepscan(missing-throw): Missing throw
╭─[missing_throw.tsx:1:18]
1 │ function foo() { new Error() }
@@ -16,4 +15,3 @@ expression: missing_throw
· ───────────
╰────
help: The `throw` keyword seems to be missing in front of this 'new' expression
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: mouse_events_have_key_events
---
⚠ eslint-plugin-jsx-a11y(mouse-events-have-key-events): onMouseOver must be accompanied by onFocus for accessibility.
╭─[mouse_events_have_key_events.tsx:1:6]
1 │ <div onMouseOver={() => void 0} />;
@@ -100,4 +99,3 @@ expression: mouse_events_have_key_events
· ─────────────────────────
╰────
help: Try to add onBlur.
+13 -2
View File
@@ -1,9 +1,7 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 148
expression: named
---
⚠ eslint-plugin-import(named): named import "somethingElse" not found
╭─[index.js:1:10]
1 │ import { somethingElse } from './test-module'
@@ -143,3 +141,16 @@ expression: named
╰────
help: does "./typescript-export-assign-object" have the export "FooBar"?
⚠ eslint-plugin-import(named): named import "baz" not found
╭─[index.js:1:10]
1 │ import { baz, quaz } from './oxc_named'
· ───
╰────
help: does "./oxc_named" have the export "baz"?
⚠ eslint-plugin-import(named): named import "quaz" not found
╭─[index.js:1:15]
1 │ import { baz, quaz } from './oxc_named'
· ────
╰────
help: does "./oxc_named" have the export "quaz"?
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: new_for_builtins
---
⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Object()` instead of `Object()`
╭─[new_for_builtins.tsx:1:16]
1 │ const object = (Object)();
@@ -288,4 +287,3 @@ expression: new_for_builtins
· ─────
20 │ }
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: next_script_for_ga
---
⚠ eslint-plugin-next(next-script-for-ga): Prefer `next/script` component when using the inline script for Google Analytics.
╭─[next_script_for_ga.tsx:7:30]
6 │ <h1>Hello title</h1>
@@ -47,4 +46,3 @@ expression: next_script_for_ga
19 │ </div>
╰────
help: See https://nextjs.org/docs/messages/next-script-for-ga
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_abusive_eslint_disable
---
⚠ eslint-plugin-unicorn(no-abusive-eslint-disable): Unexpected `eslint-disable` comment that does not specify any rules to disable.
╭─[no_abusive_eslint_disable.tsx:2:11]
1 │
@@ -61,4 +60,3 @@ expression: no_abusive_eslint_disable
3 │ eval();
╰────
help: Specify the rules you want to disable.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_access_key
---
⚠ eslint-plugin-jsx-a11y(no-access-key): No access key attribute allowed.
╭─[no_access_key.tsx:1:6]
1 │ <div accesskey="h" />
@@ -79,4 +78,3 @@ expression: no_access_key
· ──────────────────────────────────────
╰────
help: Remove the accessKey attribute. Inconsistencies between keyboard shortcuts and keyboard commands used by screenreaders and keyboard-only users create a11y complications.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_accumulating_spread
---
⚠ oxc(no-accumulating-spread): Do not spread accumulators in Array.prototype.reduce()
╭─[no_accumulating_spread.tsx:1:18]
1 │ Object.keys(obj).reduce((acc, key) => ({ ...acc, [key]: obj[key] }), {})
@@ -315,4 +314,3 @@ expression: no_accumulating_spread
╰────
help: It looks like you're spreading an `Object`. Consider using the `Object.assign` or assignment operators to mutate the accumulator instead.
Using spreads within accumulators leads to `O(n^2)` time complexity.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_alias_methods
---
⚠ eslint-plugin-jest(no-alias-methods): Unexpected alias "toBeCalled"
╭─[no_alias_methods.tsx:1:11]
1 │ expect(a).toBeCalled()
@@ -107,4 +106,3 @@ expression: no_alias_methods
· ──────────────
╰────
help: Replace "toThrowError" with its canonical name of "toThrow"
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_amd
---
⚠ eslint-plugin-import(no-amd): Do not use AMD `require` and `define` calls.
╭─[no-amd.js:1:1]
1 │ require([a, b], function() {})
@@ -44,4 +43,3 @@ expression: no_amd
· ───────
╰────
help: Expected imports instead of AMD require()
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_aria_hidden_on_focusable
---
⚠ eslint-plugin-jsx-a11y(no-aria-hidden-on-focusable): `aria-hidden` must not be true on focusable elements.
╭─[no_aria_hidden_on_focusable.tsx:1:6]
1 │ <div aria-hidden="true" tabIndex="0" />;
@@ -44,4 +43,3 @@ expression: no_aria_hidden_on_focusable
· ──────────────────
╰────
help: Remove `aria-hidden="true"` from focusable elements or modify the element to be not focusable.
@@ -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()
@@ -51,4 +50,3 @@ expression: no_array_constructor
· ──────────────
╰────
help: Use array literal instead
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_array_for_each
---
⚠ eslint-plugin-unicorn(no-array-for-each): Do not use `Array#forEach`
╭─[no_array_for_each.tsx:1:5]
1 │ foo.forEach?.(element => bar(element))
@@ -100,4 +99,3 @@ expression: no_array_for_each
· ───────
╰────
help: Replace it with a for` loop. For loop is faster, more readable, and you can use `break` or `return` to exit early.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_array_reduce
---
⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
╭─[no_array_reduce.tsx:1:7]
1 │ array.reduce((str, item) => str += item, "")
@@ -312,4 +311,3 @@ expression: no_array_reduce
3 │ return (total / item) * 100;
╰────
help: Refactor your code to use `for` loops instead.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_assign_module_variable
---
⚠ eslint-plugin-next(no-assign-module-variable): Do not assign to the variable `module`.
╭─[no_assign_module_variable.tsx:2:23]
1 │
@@ -11,4 +10,3 @@ expression: no_assign_module_variable
3 │
╰────
help: See https://nextjs.org/docs/messages/no-assign-module-variable
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_async_client_component
---
⚠ eslint-plugin-next(no-async-client-component): Prevent client components from being async functions.
╭─[no_async_client_component.tsx:4:49]
3 │
@@ -47,4 +46,3 @@ expression: no_async_client_component
5 │ return '123'
╰────
help: See: https://nextjs.org/docs/messages/no-async-client-component
@@ -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:13]
1 │ new Promise(async function foo(resolve, reject) {})
@@ -20,4 +19,3 @@ expression: no_async_promise_executor
1 │ new Promise(((((async () => {})))))
· ─────
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_autofocus
---
⚠ eslint-plugin-jsx-a11y(no-autofocus): The `autofocus` attribute is found here, which can cause usability issues for sighted and non-sighted users
╭─[no_autofocus.tsx:1:6]
1 │ <div autoFocus />
@@ -72,4 +71,3 @@ expression: no_autofocus
· ─────────
╰────
help: Remove `autofocus` attribute
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_await_expression_member
---
⚠ eslint-plugin-unicorn(no-await-expression-member): Disallow member access from await expression
╭─[no_await_expression_member.tsx:1:1]
1 │ (await promise)[0]
@@ -177,4 +176,3 @@ expression: no_await_expression_member
· ───────────────────
╰────
help: When accessing a member from an await expression, the await expression has to be parenthesized, which is not readable.
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_before_interactive_script_outside_document
---
⚠ eslint-plugin-next(no-before-interactive-script-outside-document): next/script's `beforeInteractive` strategy should not be used outside of `pages/_document.js`
╭─[no_before_interactive_script_outside_document.tsx:9:25]
8 │ src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.20/lodash.min.js?a=scriptBeforeInteractive"
@@ -56,4 +55,3 @@ expression: no_before_interactive_script_outside_document
10 │ />
╰────
help: See https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
@@ -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
@@ -93,4 +92,3 @@ expression: no_bitwise
· ────────
╰────
help: bitwise operators are not allowed, maybe you mistyped `&&` or `||`
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_caller
---
⚠ eslint(no-caller): Disallow the use of arguments.caller or arguments.callee
╭─[no_caller.tsx:1:19]
1 │ var x = arguments.callee
@@ -16,4 +15,3 @@ 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
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_case_declarations
---
⚠ eslint(no-case-declarations): Unexpected lexical declaration in case block.
╭─[no_case_declarations.tsx:1:22]
1 │ switch (a) { case 1: let x = 1; break; }
@@ -50,4 +49,3 @@ expression: no_case_declarations
1 │ switch (a) { default: class C {} break; }
· ─────
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_children_prop
---
⚠ eslint-plugin-react(no-children-prop): Avoid passing children using a prop.
╭─[no_children_prop.tsx:1:6]
1 │ <div children />;
@@ -107,4 +106,3 @@ expression: no_children_prop
· ────────
╰────
help: The canonical way to pass children in React is to use JSX elements
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_class_assign
---
⚠ eslint(no-class-assign): Unexpected re-assignment of class A
╭─[no_class_assign.tsx:1:7]
1 │ class A { } A = 0;
@@ -74,4 +73,3 @@ expression: no_class_assign
· │ ╰── A is re-assigned here
· ╰── A is declared as class here
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_commented_out_tests
---
⚠ eslint-plugin-jest(no-commented-out-tests): Some tests seem to be commented
╭─[no_commented_out_tests.tsx:1:3]
1 │ // fdescribe('foo', function () {})
@@ -166,4 +165,3 @@ expression: no_commented_out_tests
6 │ bar()
╰────
help: Remove or uncomment this comment
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
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
@@ -93,4 +92,3 @@ expression: no_compare_neg_zero
· ────────
╰────
help: Use Object.is(x, -0) to test equality with -0 and use 0 for other cases
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_cond_assign
---
⚠ eslint(no-cond-assign): Expected a conditional expression and instead saw an assignment
╭─[no_cond_assign.tsx:1:14]
1 │ var x; if (x = 0) { var b = 1; }
@@ -205,4 +204,3 @@ expression: no_cond_assign
· ─
╰────
help: Consider wrapping the assignment in additional parentheses
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_conditional_expect
---
⚠ eslint-plugin-jest(no-conditional-expect): Unexpected conditional expect
╭─[no_conditional_expect.tsx:3:34]
2 │ it('foo', () => {
@@ -407,4 +406,3 @@ expression: no_conditional_expect
4 │ });
╰────
help: Avoid calling `expect` conditionally`
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_confusing_set_timeout
---
⚠ eslint-plugin-jest(no-confusing-set-timeout)
╭─[no_confusing_set_timeout.tsx:10:17]
9 │ });
@@ -182,4 +181,3 @@ expression: no_confusing_set_timeout
6 │
╰────
help: `jest.setTimeout` should be placed before any other jest methods
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_console
---
⚠ eslint(no-console): Unexpected console statement.
╭─[no_console.tsx:1:9]
1 │ console.log()
@@ -80,4 +79,3 @@ expression: no_console
1 │ console.warn(foo)
· ────
╰────
@@ -2,7 +2,6 @@
source: crates/oxc_linter/src/tester.rs
expression: no_console_spaces
---
⚠ eslint-plugin-unicorn(no-console-spaces): Do not use trailing spaces with `console.log` parameters
╭─[no_console_spaces.tsx:1:13]
1 │ console.log("abc ", "def");
@@ -345,4 +344,3 @@ expression: no_console_spaces
· ─────
╰────
help: The `console.log()` method and similar methods join the parameters with a space so adding a leading/trailing space to a parameter, results in two spaces being added.
Loaded 100 of 291 files, more files were not shown because too many files have changed in this diff. Show more