feat(linter): remove all ESLint Stylistic rules

They are out of scopes of this project.

closes #3066
closes #3040
This commit is contained in:
Boshen 2024-04-22 10:51:21 +08:00
parent 58d6438efb
commit ae72be1964
No known key found for this signature in database
GPG key ID: 234DA6A7079C6801
14 changed files with 0 additions and 1540 deletions

View file

@ -44,7 +44,6 @@ mod eslint {
pub mod for_direction;
pub mod getter_return;
pub mod guard_for_in;
pub mod max_len;
pub mod max_lines;
pub mod max_params;
pub mod no_array_constructor;
@ -391,7 +390,6 @@ oxc_macros::declare_all_lint_rules! {
eslint::for_direction,
eslint::getter_return,
eslint::guard_for_in,
eslint::max_len,
eslint::max_lines,
eslint::max_params,
eslint::no_ternary,

File diff suppressed because it is too large Load diff

View file

@ -1,458 +0,0 @@
---
source: crates/oxc_linter/src/tester.rs
expression: max_len
---
⚠ This line has a length of 86. Maximum allowed is 80.
╭─[max_len.tsx:1:1]
1 │ var i = 1;
· ──────────────────────────────────────────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 24. Maximum allowed is 10.
╭─[max_len.tsx:1:1]
1 │ var x = 5, y = 2, z = 5;
· ────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 22. Maximum allowed is 15.
╭─[max_len.tsx:1:1]
1 │ var i = 1;
· ──────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 22. Maximum allowed is 15.
╭─[max_len.tsx:1:1]
1 │ var i = 1;
· ──────────────────────
2 │ var j = 1;
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 22. Maximum allowed is 15.
╭─[max_len.tsx:2:1]
1 │ var i = 1;
2 │ var j = 1;
· ──────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 56. Maximum allowed is 20.
╭─[max_len.tsx:1:1]
1 │ var /*this is a long non-removed inline comment*/ i = 1;
· ────────────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 54. Maximum allowed is 20.
╭─[max_len.tsx:1:1]
1 │ var foobar = 'this line isn\'t matched by the regexp';
· ──────────────────────────────────────────────────────
2 │ var fizzbuzz = 'but this one is matched by the regexp';
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 30. Maximum allowed is 10.
╭─[max_len.tsx:1:1]
1 │ var longLine = 'will trigger'; // even with a comment
· ─────────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 62. Maximum allowed is 40.
╭─[max_len.tsx:1:1]
1 │ var foo = module.exports = {}; // really long trailing comment
· ──────────────────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 57. Maximum allowed is 40.
╭─[max_len.tsx:1:1]
1 │ foo('http://example.com/this/is/?a=longish&url=in#here');
· ─────────────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 53. Maximum allowed is 40.
╭─[max_len.tsx:1:1]
1 │ foo(bar(bazz('this is a long'), 'line of'), 'stuff');
· ─────────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 49. Maximum allowed is 20.
╭─[max_len.tsx:1:1]
1 │ // A comment that exceeds the max comment length.
· ─────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 119. Maximum allowed is 80.
╭─[max_len.tsx:1:1]
1 │ // A comment that exceeds the max comment length and the max code length, but will fail for being too long of a comment
· ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 49. Maximum allowed is 20.
╭─[max_len.tsx:1:1]
1 │ // A comment that exceeds the max comment length.
· ─────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 73. Maximum allowed is 40.
╭─[max_len.tsx:1:1]
1 │ //This is very long comment with more than 40 characters which is invalid
· ─────────────────────────────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 29. Maximum allowed is 28.
╭─[max_len.tsx:2:1]
1 │ function foo() {
2 │ //this line has 29 characters
· ─────────────────────────────
3 │ }
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 33. Maximum allowed is 32.
╭─[max_len.tsx:2:1]
1 │ function foo() {
2 │ //this line has 33 characters
· ─────────────────────────────────
3 │ }
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 29. Maximum allowed is 28.
╭─[max_len.tsx:2:1]
1 │ function foo() {
2 │ /*this line has 29 characters
· ─────────────────────────────
3 │ and this one has 32 characters*/
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 32. Maximum allowed is 28.
╭─[max_len.tsx:3:1]
2 │ /*this line has 29 characters
3 │ and this one has 32 characters*/
· ────────────────────────────────
4 │ }
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 33. Maximum allowed is 32.
╭─[max_len.tsx:2:1]
1 │ function foo() {
2 │ /*this line has 33 characters
· ─────────────────────────────────
3 │ and this one has 36 characters*/
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 36. Maximum allowed is 32.
╭─[max_len.tsx:3:1]
2 │ /*this line has 33 characters
3 │ and this one has 36 characters*/
· ────────────────────────────────────
4 │ }
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 40. Maximum allowed is 39.
╭─[max_len.tsx:2:1]
1 │ function foo() {
2 │ var a; /*this line has 40 characters
· ────────────────────────────────────────
3 │ and this one has 36 characters*/
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 36. Maximum allowed is 35.
╭─[max_len.tsx:3:1]
2 │ var a; /*this line has 40 characters
3 │ and this one has 36 characters*/
· ────────────────────────────────────
4 │ }
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 33. Maximum allowed is 32.
╭─[max_len.tsx:2:1]
1 │ function foo() {
2 │ /*this line has 33 characters
· ─────────────────────────────────
3 │ and this one has 43 characters*/ var a;
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 43. Maximum allowed is 42.
╭─[max_len.tsx:3:1]
2 │ /*this line has 33 characters
3 │ and this one has 43 characters*/ var a;
· ───────────────────────────────────────────
4 │ }
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 51. Maximum allowed is 20.
╭─[max_len.tsx:2:1]
1 │ // This commented line has precisely 51 characters.
2 │ var x = 'This line also has exactly 51 characters';
· ───────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 39. Maximum allowed is 29.
╭─[max_len.tsx:2:1]
1 │ var foo = veryLongIdentifier;
2 │ var bar = 'this is a very long string';
· ───────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 45. Maximum allowed is 29.
╭─[max_len.tsx:2:1]
1 │ var foo = veryLongIdentifier;
2 │ var bar = /this is a very very long pattern/;
· ─────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 57. Maximum allowed is 29.
╭─[max_len.tsx:2:1]
1 │ var foo = veryLongIdentifier;
2 │ var bar = new RegExp('this is a very very long pattern');
· ─────────────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 39. Maximum allowed is 29.
╭─[max_len.tsx:2:1]
1 │ var foo = veryLongIdentifier;
2 │ var bar = "this is a very long string";
· ───────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 39. Maximum allowed is 29.
╭─[max_len.tsx:2:1]
1 │ var foo = veryLongIdentifier;
2 │ var bar = `this is a very long string`;
· ───────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 37. Maximum allowed is 29.
╭─[max_len.tsx:2:1]
1 │ var foo = veryLongIdentifier;
2 │ var bar = `this is a very long string
· ─────────────────────────────────────
3 │ and this is another line that is very long`;
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 44. Maximum allowed is 29.
╭─[max_len.tsx:3:1]
2 │ var bar = `this is a very long string
3 │ and this is another line that is very long`;
· ────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 58. Maximum allowed is 29.
╭─[max_len.tsx:1:1]
1 │ var foo = <div>this is a very very very long string</div>;
· ──────────────────────────────────────────────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 12. Maximum allowed is 10.
╭─[max_len.tsx:1:1]
1 │ '🙁😁😟☹️😣😖😩😱👎'
· ───────────────────
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 1. Maximum allowed is 0.
╭─[max_len.tsx:1:1]
1 │ a
· ─
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 38. Maximum allowed is 37.
╭─[max_len.tsx:2:1]
1 │ var jsx = (<>
2 │ { /* this line has 38 characters */}
· ──────────────────────────────────────
3 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a comment length of 44. Maximum allowed is 40.
╭─[max_len.tsx:2:1]
1 │ var jsx = (<>
2 │ { /* this line has 40 characters */}
· ────────────────────────────────────────────
3 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 38. Maximum allowed is 15.
╭─[max_len.tsx:2:1]
1 │ var jsx = (<>
2 │ { 38/* this line has 38 characters */}
· ──────────────────────────────────────
3 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 38. Maximum allowed is 37.
╭─[max_len.tsx:2:1]
1 │ var jsx = (<>
2 │ { 38/* this line has 38 characters */}
· ──────────────────────────────────────
3 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 38. Maximum allowed is 37.
╭─[max_len.tsx:2:1]
1 │ var jsx = (<>
2 │ { 38/* this line has 38 characters */}
· ──────────────────────────────────────
3 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 50. Maximum allowed is 49.
╭─[max_len.tsx:2:1]
1 │ var jsx = (<>
2 │ <> 50 </>{ 50/* this line has 50 characters */}
· ──────────────────────────────────────────────────
3 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 44. Maximum allowed is 37.
╭─[max_len.tsx:2:1]
1 │ var jsx = (<>
2 │ {/* this line has 44 characters */}
· ────────────────────────────────────────────
3 │ <> </> {/* this line has 44 characters */}
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 57. Maximum allowed is 56.
╭─[max_len.tsx:2:1]
1 │ var jsx = <Foo
2 │ attr = {a && b/* this line has 57 characters */}
· ─────────────────────────────────────────────────────────
3 │ ></Foo>;
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 57. Maximum allowed is 56.
╭─[max_len.tsx:2:1]
1 │ var jsx = <Foo
2 │ attr = {/* this line has 57 characters */a && b}
· ─────────────────────────────────────────────────────────
3 │ ></Foo>;
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 56. Maximum allowed is 55.
╭─[max_len.tsx:2:1]
1 │ var jsx = <Foo
2 │ attr = {a & b/* this line has 56 characters */}
· ────────────────────────────────────────────────────────
3 │ ></Foo>;
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 51. Maximum allowed is 30.
╭─[max_len.tsx:3:1]
2 │ attr =
3 │ {a & b /* this line has 51 characters */}
· ───────────────────────────────────────────────────
4 │ ></Foo>;
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 80. Maximum allowed is 79.
╭─[max_len.tsx:3:1]
2 │ {/* this line has 37 characters */}
3 │ <> </> {/* this line with two separate comments */} {/* have 80 characters */}
· ────────────────────────────────────────────────────────────────────────────────
4 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 87. Maximum allowed is 85.
╭─[max_len.tsx:2:1]
1 │ var jsx = (<>
2 │ <> </> {/* this line with two separate comments */} {/* have 87 characters */} <> </>
· ───────────────────────────────────────────────────────────────────────────────────────
3 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 87. Maximum allowed is 37.
╭─[max_len.tsx:3:1]
2 │ {/* this line has 37 characters */}
3 │ <> </> {/* this line with two separate comments */} {/* have 87 characters */} <> </>
· ───────────────────────────────────────────────────────────────────────────────────────
4 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 119. Maximum allowed is 37.
╭─[max_len.tsx:3:1]
2 │ {/* this line has 37 characters */}
3 │ <> </> {/* this line with two separate comments */} {/* have > 80 characters */ /* another comment in same braces */}
· ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
4 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 55. Maximum allowed is 37.
╭─[max_len.tsx:3:1]
2 │ {/* this line has 37 characters */}
3 │ <> </> {/* this is not treated as a comment */ a & b} {/* trailing */ /* comments */}
· ───────────────────────────────────────────────────────────────────────────────────────
4 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 55. Maximum allowed is 37.
╭─[max_len.tsx:3:1]
2 │ {/* this line has 37 characters */}
3 │ <> </> {/* this is not treated as a comment */ a & b} {/* trailing */ /* comments */}
· ───────────────────────────────────────────────────────────────────────────────────────
4 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 15. Maximum allowed is 14.
╭─[max_len.tsx:2:1]
1 │ var jsx = (<>
2 │ 12345678901234{/*
· ─────────────────
3 │ */}
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable
⚠ This line has a length of 31. Maximum allowed is 30.
╭─[max_len.tsx:3:1]
2 │ {/*
3 │ this line has 31 characters */}
· ───────────────────────────────
4 │ </>)
╰────
help: Consider breaking this line into multiple lines or shortening comments/codes where applicable

View file

@ -1,57 +0,0 @@
---
source: crates/oxc_linter/src/tester.rs
expression: no_unresolved
---
⚠ eslint-plugin-import(no-unresolved): Ensure imports point to a file/module that can be resolved
╭─[index.ts:1:24]
1 │ import reallyfake from "./reallyfake/module"
· ─────────────────────
╰────
⚠ eslint-plugin-import(no-unresolved): Ensure imports point to a file/module that can be resolved
╭─[index.ts:1:17]
1 │ import bar from './baz';
· ───────
╰────
⚠ eslint-plugin-import(no-unresolved): Ensure imports point to a file/module that can be resolved
╭─[index.ts:1:17]
1 │ import bar from './baz';
· ───────
╰────
⚠ eslint-plugin-import(no-unresolved): Ensure imports point to a file/module that can be resolved
╭─[index.ts:1:17]
1 │ import bar from './empty-folder';
· ────────────────
╰────
⚠ eslint-plugin-import(no-unresolved): Ensure imports point to a file/module that can be resolved
╭─[index.ts:1:22]
1 │ import { DEEP } from 'in-alternate-root';
· ───────────────────
╰────
⚠ eslint-plugin-import(no-unresolved): Ensure imports point to a file/module that can be resolved
╭─[index.ts:1:21]
1 │ export { foo } from "./does-not-exist"
· ──────────────────
╰────
⚠ eslint-plugin-import(no-unresolved): Ensure imports point to a file/module that can be resolved
╭─[index.ts:1:15]
1 │ export * from "./does-not-exist"
· ──────────────────
╰────
⚠ eslint-plugin-import(no-unresolved): Ensure imports point to a file/module that can be resolved
╭─[index.ts:1:22]
1 │ export * as bar from "./does-not-exist"
· ──────────────────
╰────
× Unexpected token
╭─[index.ts:1:8]
1 │ export bar from "./does-not-exist"
· ───
╰────

View file

@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 151
expression: no_untyped_mock_factory
---
⚠ eslint-plugin-jest(no-untyped-mock-factory): Disallow using `jest.mock()` factories without an explicit type parameter.

View file

@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 151
expression: prefer_comparison_matcher
---
⚠ eslint-plugin-jest(prefer-comparison-matcher): Suggest using the built-in comparison matchers

View file

@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 151
expression: prefer_expect_resolves
---
⚠ eslint-plugin-jest(prefer-expect-resolves): Prefer `await expect(...).resolves` over `expect(await ...)` syntax.

View file

@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 151
expression: prefer_lowercase_title
---
⚠ eslint-plugin-jest(prefer-lowercase-title): Enforce lowercase test names

View file

@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 151
expression: prefer_mock_promise_shorthand
---
⚠ eslint-plugin-jest(prefer-mock-promise-shorthand): Prefer mock resolved/rejected shorthands for promises

View file

@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 151
expression: prefer_spy_on
---
⚠ eslint-plugin-jest(prefer-spy-on): Suggest using `jest.spyOn()`.

View file

@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 151
expression: prefer_strict_equal
---
⚠ eslint-plugin-jest(prefer-strict-equal): Suggest using `toStrictEqual()`.

View file

@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 151
expression: prefer_to_be
---
⚠ eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.

View file

@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 151
expression: prefer_to_contain
---
⚠ eslint-plugin-jest(prefer-to-contain): Suggest using `toContain()`.

View file

@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 151
expression: prefer_to_have_length
---
⚠ eslint-plugin-jest(prefer-to-have-length): Suggest using `toHaveLength()`.