diff --git a/.cargo/config.toml b/.cargo/config.toml index e2b931bf5..2e7aff007 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -53,8 +53,9 @@ rustflags = [ # This rule is too pedantic, I don't want to force this because naming things are hard. "-Aclippy::module_name_repetitions", - # Most usages are ignored in our codebase, so this is ignored. + # All triggers are mostly ignored in our codebase, so this is ignored globally. "-Aclippy::struct_excessive_bools", + "-Aclippy::too_many_lines", # #[must_use] is creating too much noise for this codebase, it does not add much value execept nagging # the programmer to add a #[must_use] after clippy has been run. diff --git a/crates/oxc_ast/src/ast_kind.rs b/crates/oxc_ast/src/ast_kind.rs index 559207bbc..1e81c7390 100644 --- a/crates/oxc_ast/src/ast_kind.rs +++ b/crates/oxc_ast/src/ast_kind.rs @@ -239,7 +239,7 @@ impl<'a> AstKind<'a> { } impl<'a> GetSpan for AstKind<'a> { - #[allow(clippy::match_same_arms, clippy::too_many_lines)] + #[allow(clippy::match_same_arms)] fn span(&self) -> Span { match self { Self::Program(x) => x.span, @@ -386,7 +386,7 @@ impl<'a> GetSpan for AstKind<'a> { #[cfg(debug_assertions)] impl<'a> AstKind<'a> { - #[allow(clippy::match_same_arms, clippy::too_many_lines)] + #[allow(clippy::match_same_arms)] /// Get the AST kind name with minimal details. Particularly useful for /// when debugging an iteration over an AST. /// diff --git a/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs b/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs index 1c63433e4..58805cf95 100644 --- a/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs +++ b/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs @@ -251,7 +251,6 @@ fn full_array_method_name(array_method: &'static str) -> Atom { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/getter_return.rs b/crates/oxc_linter/src/rules/eslint/getter_return.rs index 2c97d62e4..b6af3ef04 100644 --- a/crates/oxc_linter/src/rules/eslint/getter_return.rs +++ b/crates/oxc_linter/src/rules/eslint/getter_return.rs @@ -192,7 +192,6 @@ impl Rule for GetterReturn { } } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs b/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs index 05bb021c7..881e0d7fa 100644 --- a/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs +++ b/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs @@ -377,7 +377,6 @@ impl NoConstantBinaryExpression { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs b/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs index b17d21335..2b668917a 100644 --- a/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs +++ b/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs @@ -68,7 +68,6 @@ impl Rule for NoConstantCondition { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs b/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs index 3c69d0b01..f47de9cf6 100644 --- a/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs +++ b/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs @@ -64,7 +64,6 @@ impl Rule for NoDuplicateCase { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs b/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs index d9c558e66..e7aa6dbae 100644 --- a/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs +++ b/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs @@ -204,7 +204,6 @@ fn get_real_parent<'a, 'b>(node: &AstNode, ctx: &'a LintContext<'b>) -> Option<& None } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs b/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs index 1035f91d5..65a687121 100644 --- a/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs +++ b/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs @@ -239,7 +239,6 @@ impl NoLossOfPrecision { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/no_return_await.rs b/crates/oxc_linter/src/rules/eslint/no_return_await.rs index 66627698b..4a07cfbe2 100644 --- a/crates/oxc_linter/src/rules/eslint/no_return_await.rs +++ b/crates/oxc_linter/src/rules/eslint/no_return_await.rs @@ -143,7 +143,6 @@ fn has_error_handler<'a>(node: &AstNode<'a>, ctx: &LintContext<'a>) -> bool { false } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/no_setter_return.rs b/crates/oxc_linter/src/rules/eslint/no_setter_return.rs index dfe4af3ff..4bb5cdac6 100644 --- a/crates/oxc_linter/src/rules/eslint/no_setter_return.rs +++ b/crates/oxc_linter/src/rules/eslint/no_setter_return.rs @@ -48,7 +48,6 @@ impl Rule for NoSetterReturn { } } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs b/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs index d937cd617..99bc3a22d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs @@ -71,7 +71,6 @@ impl Rule for NoUselessCatch { } } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs b/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs index 8be62bc67..7b658c168 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs @@ -195,7 +195,6 @@ fn check_template(string: &str) -> Vec { offsets } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/use_isnan.rs b/crates/oxc_linter/src/rules/eslint/use_isnan.rs index 8f260d46e..1c587523e 100644 --- a/crates/oxc_linter/src/rules/eslint/use_isnan.rs +++ b/crates/oxc_linter/src/rules/eslint/use_isnan.rs @@ -163,7 +163,6 @@ fn is_target_callee<'a>(callee: &'a Expression<'a>) -> Option<&'static str> { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/eslint/valid_typeof.rs b/crates/oxc_linter/src/rules/eslint/valid_typeof.rs index c3c2956c2..2a5da67d9 100644 --- a/crates/oxc_linter/src/rules/eslint/valid_typeof.rs +++ b/crates/oxc_linter/src/rules/eslint/valid_typeof.rs @@ -140,7 +140,6 @@ const VALID_TYPES: Set<&'static str> = phf_set! { }; #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/jest/expect_expect.rs b/crates/oxc_linter/src/rules/jest/expect_expect.rs index 46d195fa9..965587f47 100644 --- a/crates/oxc_linter/src/rules/jest/expect_expect.rs +++ b/crates/oxc_linter/src/rules/jest/expect_expect.rs @@ -201,7 +201,6 @@ fn convert_pattern(pattern: &str) -> String { format!("(?ui)^{pattern}(\\.|$)") } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs b/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs index 5dfca73b9..1f6e6bf6a 100644 --- a/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs +++ b/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs @@ -118,7 +118,6 @@ fn check_parents<'a>(node: &AstNode<'a>, ctx: &LintContext<'a>, in_conditional: check_parents(parent, ctx, in_conditional) } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; @@ -292,7 +291,7 @@ fn test() { } catch { // ignore errors } - + expect(something).toHaveBeenCalled(); }); ", @@ -351,7 +350,7 @@ fn test() { " it('works', async () => { await doSomething().catch(error => error); - + expect(error).toBeInstanceOf(Error); }); ", @@ -367,7 +366,7 @@ fn test() { } catch { // ignore errors } - + expect(something).toHaveBeenCalled(); }); ", @@ -435,9 +434,9 @@ fn test() { ( " function getValue() { - something && expect(something).toHaveBeenCalled(); + something && expect(something).toHaveBeenCalled(); } - + it('foo', getValue); ", None, @@ -469,9 +468,9 @@ fn test() { ( " function getValue() { - something || expect(something).toHaveBeenCalled(); + something || expect(something).toHaveBeenCalled(); } - + it('foo', getValue); ", None, @@ -489,7 +488,7 @@ fn test() { function getValue() { something ? expect(something).toHaveBeenCalled() : noop(); } - + it('foo', getValue); ", None, @@ -523,7 +522,7 @@ fn test() { function getValue() { something ? noop() : expect(something).toHaveBeenCalled(); } - + it('foo', getValue); ", None, @@ -590,7 +589,7 @@ fn test() { expect(something).toHaveBeenCalled(); } } - + it('foo', getValue); ", None, @@ -648,7 +647,7 @@ fn test() { expect(something).toHaveBeenCalled(); } } - + it('foo', getValue); ", None, @@ -662,7 +661,7 @@ fn test() { expect(something).toHaveBeenCalled(); } } - + it('foo', getValue); ", None, @@ -671,7 +670,7 @@ fn test() { " it('foo', () => { try { - + } catch (err) { expect(err).toMatch('Error'); } @@ -683,7 +682,7 @@ fn test() { " it.each``('foo', () => { try { - + } catch (err) { expect(err).toMatch('Error'); } @@ -695,7 +694,7 @@ fn test() { " it.each()('foo', () => { try { - + } catch (err) { expect(err).toMatch('Error'); } @@ -707,7 +706,7 @@ fn test() { " it.skip.each``('foo', () => { try { - + } catch (err) { expect(err).toMatch('Error'); } @@ -719,7 +718,7 @@ fn test() { " it.skip.each()('foo', () => { try { - + } catch (err) { expect(err).toMatch('Error'); } @@ -736,7 +735,7 @@ fn test() { expect(something).toHaveBeenCalled(); } } - + it('foo', getValue); ", None, diff --git a/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs b/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs index 90d2091bd..6725b59a7 100644 --- a/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs +++ b/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs @@ -237,7 +237,6 @@ fn is_jest_call(name: &Atom) -> bool { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/jest/no_done_callback.rs b/crates/oxc_linter/src/rules/jest/no_done_callback.rs index b01a79af3..06599a23c 100644 --- a/crates/oxc_linter/src/rules/jest/no_done_callback.rs +++ b/crates/oxc_linter/src/rules/jest/no_done_callback.rs @@ -196,7 +196,6 @@ impl Message { } } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; @@ -283,7 +282,7 @@ fn test() { ( " import { beforeEach } from '@jest/globals'; - + beforeEach((done) => { done(); }); @@ -293,7 +292,7 @@ fn test() { ( " import { beforeEach as atTheStartOfEachTest } from '@jest/globals'; - + atTheStartOfEachTest((done) => { done(); }); diff --git a/crates/oxc_linter/src/rules/jest/no_identical_title.rs b/crates/oxc_linter/src/rules/jest/no_identical_title.rs index cb22a2a2c..aecc53fd1 100644 --- a/crates/oxc_linter/src/rules/jest/no_identical_title.rs +++ b/crates/oxc_linter/src/rules/jest/no_identical_title.rs @@ -180,7 +180,6 @@ impl Message { } } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs b/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs index 59d12ec2e..64a479bd5 100644 --- a/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs +++ b/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs @@ -185,7 +185,6 @@ fn is_var_declarator_or_test_block<'a>( false } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; @@ -212,7 +211,7 @@ fn test() { `('trues', ({ value }) => { expect(value).toBe(true); }); - ", + ", None ), ("it.only('an only', value => { expect(value).toBe(true); });", None), @@ -277,7 +276,7 @@ fn test() { ]).test('returns the result of adding %d to %d', (a, b, expected) => { expect(a + b).toBe(expected); }); - ", + ", Some(serde_json::json!([{ "additionalTestBlockFunctions": ["each"] }])) ), ( @@ -289,7 +288,7 @@ fn test() { ]).test('returns the result of adding %d to %d', (a, b, expected) => { expect(a + b).toBe(expected); }); - ", + ", Some(serde_json::json!([{ "additionalTestBlockFunctions": ["test"] }])) ), ("describe('a test', () => { expect(1).toBe(1); });", None), @@ -304,7 +303,7 @@ fn test() { " import { expect as pleaseExpect } from '@jest/globals'; describe('a test', () => { pleaseExpect(1).toBe(1); }); - ", + ", None ), ( diff --git a/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs b/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs index 43ed87a3d..b39722e3b 100644 --- a/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs +++ b/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs @@ -183,7 +183,6 @@ impl Message { } } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/jest/valid_expect.rs b/crates/oxc_linter/src/rules/jest/valid_expect.rs index 4662678b9..9deeab786 100644 --- a/crates/oxc_linter/src/rules/jest/valid_expect.rs +++ b/crates/oxc_linter/src/rules/jest/valid_expect.rs @@ -372,7 +372,6 @@ fn test_1() { Tester::new(ValidExpect::NAME, pass, fail).test_and_snapshot(); } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; @@ -424,7 +423,7 @@ fn test() { return expect(Promise.resolve(2)).resolves.toBe(1); }); }); - ", + ", None ), ( @@ -434,7 +433,7 @@ fn test() { await expect(Promise.resolve(2)).resolves.toBe(1); }); }); - ", + ", None ), ( @@ -442,7 +441,7 @@ fn test() { test('valid-expect', () => { return expect(functionReturningAPromise()).resolves.toEqual(1).then(() => expect(Promise.resolve(2)).resolves.toBe(1)); }); - ", + ", None ), ( @@ -454,7 +453,7 @@ fn test() { : expect(obj).resolves.not.toThrow(); } }); - ", + ", None ), ( @@ -466,7 +465,7 @@ fn test() { : expect(obj).toBe(true); } }); - ", + ", None ), ( @@ -480,7 +479,7 @@ fn test() { : expect(obj).toBe(false) } }); - ", + ", None ), ("expect(1).toBe(2);", Some(serde_json::json!([{ "maxArgs": 2 }]))), @@ -526,7 +525,7 @@ fn test() { : expect(obj).resolves.not.toThrow(); } }); - ", + ", None ), ( @@ -538,7 +537,7 @@ fn test() { : expect(obj).toBe(true); } }); - ", + ", None ), ( @@ -552,7 +551,7 @@ fn test() { : expect(obj).toBe(false) } }); - ", + ", None ), ("test('valid-expect', () => { expect(Promise.resolve(2)).resolves.toBeDefined(); });", None), @@ -573,7 +572,7 @@ fn test() { expect(Promise.resolve(2)).resolves.not.toBeDefined(); expect(Promise.resolve(1)).rejects.toBeDefined(); }); - ", + ", None ), ( @@ -591,7 +590,7 @@ fn test() { expect(Promise.resolve(2)).resolves.not.toBeDefined(); return expect(Promise.resolve(1)).rejects.toBeDefined(); }); - ", + ", Some(serde_json::json!([{ "alwaysAwait": true }])) ), ( @@ -600,7 +599,7 @@ fn test() { expect(Promise.resolve(2)).resolves.not.toBeDefined(); return expect(Promise.resolve(1)).rejects.toBeDefined(); }); - ", + ", None ), ( @@ -609,7 +608,7 @@ fn test() { await expect(Promise.resolve(2)).resolves.not.toBeDefined(); return expect(Promise.resolve(1)).rejects.toBeDefined(); }); - ", + ", Some(serde_json::json!([{ "alwaysAwait": true }])) ), ( @@ -626,7 +625,7 @@ fn test() { test('valid-expect', () => { Promise.resolve(expect(Promise.resolve(2)).resolves.not.toBeDefined()); }); - ", + ", None ), ( @@ -634,7 +633,7 @@ fn test() { test('valid-expect', () => { Promise.reject(expect(Promise.resolve(2)).resolves.not.toBeDefined()); }); - ", + ", None ), ( @@ -642,7 +641,7 @@ fn test() { test('valid-expect', () => { Promise.x(expect(Promise.resolve(2)).resolves.not.toBeDefined()); }); - ", + ", None ), ( @@ -650,7 +649,7 @@ fn test() { test('valid-expect', () => { Promise.resolve(expect(Promise.resolve(2)).resolves.not.toBeDefined()); }); - ", + ", Some(serde_json::json!([{ "alwaysAwait": true }])) ), ( @@ -661,7 +660,7 @@ fn test() { expect(Promise.resolve(3)).resolves.not.toBeDefined(), ]); }); - ", + ", None ), ( @@ -672,7 +671,7 @@ fn test() { expect(Promise.resolve(3)).resolves.not.toBeDefined(), ]); }); - ", + ", None ), ( @@ -683,7 +682,7 @@ fn test() { expect(Promise.resolve(3)).resolves.not.toBeDefined(), ] }); - ", + ", None ), ( @@ -694,7 +693,7 @@ fn test() { expect(Promise.resolve(3)).toReject(), ] }); - ", + ", None ), ( @@ -705,7 +704,7 @@ fn test() { expect(Promise.resolve(3)).resolves.toReject(), ] }); - ", + ", None ), ("expect(Promise.resolve(2)).resolves.toBe;", None), @@ -716,7 +715,7 @@ fn test() { expect(Promise.resolve(2)).resolves.toBe(1); }); }); - ", + ", None ), ( @@ -727,7 +726,7 @@ fn test() { expect(Promise.resolve(4)).resolves.toBe(4); }); }); - ", + ", None ), ( diff --git a/crates/oxc_linter/src/rules/jest/valid_title.rs b/crates/oxc_linter/src/rules/jest/valid_title.rs index b6d374f83..78e452fd5 100644 --- a/crates/oxc_linter/src/rules/jest/valid_title.rs +++ b/crates/oxc_linter/src/rules/jest/valid_title.rs @@ -362,7 +362,6 @@ impl Message { } } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; @@ -411,7 +410,7 @@ fn test() { expect(true).toBe(true); }); }); - + describe('e2e tests #e2e', () => { it('is another test #jest4life', () => {}); }); @@ -483,7 +482,7 @@ fn test() { None, ), ( - "it(`GIVEN... + "it(`GIVEN... `, () => {});", Some(serde_json::json!([{ "ignoreSpaces": true }])), ), @@ -790,7 +789,7 @@ fn test() { ( " import { test as testThat } from '@jest/globals'; - + testThat('foo works ', () => {}); ", None, diff --git a/crates/oxc_linter/src/rules/typescript/adjacent_overload_signatures.rs b/crates/oxc_linter/src/rules/typescript/adjacent_overload_signatures.rs index 2fb889136..637eced1e 100644 --- a/crates/oxc_linter/src/rules/typescript/adjacent_overload_signatures.rs +++ b/crates/oxc_linter/src/rules/typescript/adjacent_overload_signatures.rs @@ -322,7 +322,6 @@ impl Rule for AdjacentOverloadSignatures { } } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/typescript/ban_ts_comment.rs b/crates/oxc_linter/src/rules/typescript/ban_ts_comment.rs index b8cd949fa..99893f914 100644 --- a/crates/oxc_linter/src/rules/typescript/ban_ts_comment.rs +++ b/crates/oxc_linter/src/rules/typescript/ban_ts_comment.rs @@ -206,7 +206,6 @@ pub fn find_ts_comment_directive(raw: &str, single_line: bool) -> Option<(&str, } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; @@ -260,7 +259,7 @@ fn test() { (r#" /* @ts-nocheck running with long description in a block - */"#, + */"#, Some(serde_json::json!([ { "ts-nocheck": "allow-with-description", diff --git a/crates/oxc_linter/src/rules/typescript/ban_types.rs b/crates/oxc_linter/src/rules/typescript/ban_types.rs index 04883d866..bf81ef66a 100644 --- a/crates/oxc_linter/src/rules/typescript/ban_types.rs +++ b/crates/oxc_linter/src/rules/typescript/ban_types.rs @@ -87,7 +87,6 @@ impl Rule for BanTypes { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; @@ -144,7 +143,7 @@ fn test() { " class Test extends Foo implements Bar { constructor(foo: String | Object | Function) {} - + arg(): Array { const foo: String = 1 as String; } diff --git a/crates/oxc_linter/src/rules/typescript/no_duplicate_enum_values.rs b/crates/oxc_linter/src/rules/typescript/no_duplicate_enum_values.rs index 149e9bea3..2dd04d5ef 100644 --- a/crates/oxc_linter/src/rules/typescript/no_duplicate_enum_values.rs +++ b/crates/oxc_linter/src/rules/typescript/no_duplicate_enum_values.rs @@ -68,7 +68,6 @@ impl Rule for NoDuplicateEnumValues { } } -#[allow(clippy::too_many_lines)] #[test] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/typescript/no_explicit_any.rs b/crates/oxc_linter/src/rules/typescript/no_explicit_any.rs index a20e110fa..948e35319 100644 --- a/crates/oxc_linter/src/rules/typescript/no_explicit_any.rs +++ b/crates/oxc_linter/src/rules/typescript/no_explicit_any.rs @@ -135,7 +135,6 @@ mod tests { Tester::new_without_config(NoExplicitAny::NAME, pass, fail).test(); } - #[allow(clippy::too_many_lines)] #[test] fn test() { let pass = vec![ diff --git a/crates/oxc_linter/src/rules/typescript/no_namespace.rs b/crates/oxc_linter/src/rules/typescript/no_namespace.rs index 667235da5..b246570e3 100644 --- a/crates/oxc_linter/src/rules/typescript/no_namespace.rs +++ b/crates/oxc_linter/src/rules/typescript/no_namespace.rs @@ -103,7 +103,6 @@ fn is_declaration(node: &AstNode, ctx: &LintContext) -> bool { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/unicorn/no_console_spaces.rs b/crates/oxc_linter/src/rules/unicorn/no_console_spaces.rs index 83eecf402..d7e73f46b 100644 --- a/crates/oxc_linter/src/rules/unicorn/no_console_spaces.rs +++ b/crates/oxc_linter/src/rules/unicorn/no_console_spaces.rs @@ -143,7 +143,6 @@ fn report_diagnostic( } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/unicorn/no_thenable.rs b/crates/oxc_linter/src/rules/unicorn/no_thenable.rs index 56e9f8217..77d672978 100644 --- a/crates/oxc_linter/src/rules/unicorn/no_thenable.rs +++ b/crates/oxc_linter/src/rules/unicorn/no_thenable.rs @@ -57,7 +57,6 @@ declare_oxc_lint!( ); impl Rule for NoThenable { - #[allow(clippy::too_many_lines)] fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) { match node.kind() { AstKind::ObjectExpression(expr) => { @@ -281,7 +280,6 @@ fn contains_then(key: &PropertyKey, ctx: &LintContext) -> Option { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_linter/src/rules/unicorn/prefer_array_flat_map.rs b/crates/oxc_linter/src/rules/unicorn/prefer_array_flat_map.rs index 9798170d3..1cdccaa40 100644 --- a/crates/oxc_linter/src/rules/unicorn/prefer_array_flat_map.rs +++ b/crates/oxc_linter/src/rules/unicorn/prefer_array_flat_map.rs @@ -89,7 +89,6 @@ impl Rule for PreferArrayFlatMap { } #[test] -#[allow(clippy::too_many_lines)] fn test() { use crate::tester::Tester; diff --git a/crates/oxc_macros/src/declare_all_lint_rules/mod.rs b/crates/oxc_macros/src/declare_all_lint_rules/mod.rs index d86b8d883..117631ab8 100644 --- a/crates/oxc_macros/src/declare_all_lint_rules/mod.rs +++ b/crates/oxc_macros/src/declare_all_lint_rules/mod.rs @@ -40,7 +40,7 @@ impl Parse for AllLintRulesMeta { } } -#[allow(clippy::cognitive_complexity, clippy::too_many_lines)] +#[allow(clippy::cognitive_complexity)] pub fn declare_all_lint_rules(metadata: AllLintRulesMeta) -> TokenStream { let AllLintRulesMeta { rules } = metadata; // all the top-level module trees diff --git a/crates/oxc_minifier/src/compressor/fold.rs b/crates/oxc_minifier/src/compressor/fold.rs index adebfcf72..c8b60feb2 100644 --- a/crates/oxc_minifier/src/compressor/fold.rs +++ b/crates/oxc_minifier/src/compressor/fold.rs @@ -595,7 +595,6 @@ impl<'a> Compressor<'a> { None } - #[allow(clippy::too_many_lines)] fn try_fold_unary_operator( &mut self, unary_expr: &UnaryExpression<'a>, diff --git a/crates/oxc_minifier/tests/mod.rs b/crates/oxc_minifier/tests/mod.rs index 01a2e1108..6ef355b94 100644 --- a/crates/oxc_minifier/tests/mod.rs +++ b/crates/oxc_minifier/tests/mod.rs @@ -1,5 +1,3 @@ -#![allow(clippy::too_many_lines)] - mod closure; mod esbuild; mod oxc; diff --git a/crates/oxc_parser/src/js/class.rs b/crates/oxc_parser/src/js/class.rs index 99863775c..da7b13665 100644 --- a/crates/oxc_parser/src/js/class.rs +++ b/crates/oxc_parser/src/js/class.rs @@ -159,7 +159,6 @@ impl<'a> Parser<'a> { Ok(self.ast.class_body(self.end_span(span), body)) } - #[allow(clippy::too_many_lines)] pub(crate) fn parse_class_element(&mut self) -> Result> { let span = self.start_span(); diff --git a/crates/oxc_parser/src/lexer/kind.rs b/crates/oxc_parser/src/lexer/kind.rs index 89e2aed7e..f99c8725e 100644 --- a/crates/oxc_parser/src/lexer/kind.rs +++ b/crates/oxc_parser/src/lexer/kind.rs @@ -478,7 +478,6 @@ impl Kind { } } - #[allow(clippy::too_many_lines)] pub fn to_str(self) -> &'static str { match self { Undetermined => "Unknown", diff --git a/crates/oxc_query/src/adapter.rs b/crates/oxc_query/src/adapter.rs index acbdd246b..eb43cad18 100644 --- a/crates/oxc_query/src/adapter.rs +++ b/crates/oxc_query/src/adapter.rs @@ -59,7 +59,6 @@ impl<'a, 'b: 'a> trustfall::provider::Adapter<'a> for &'a Adapter<'b> { } } - #[allow(clippy::too_many_lines)] fn resolve_property( &self, contexts: ContextIterator<'a, Self::Vertex>, @@ -301,7 +300,6 @@ impl<'a, 'b: 'a> trustfall::provider::Adapter<'a> for &'a Adapter<'b> { } } - #[allow(clippy::too_many_lines)] fn resolve_neighbors( &self, contexts: ContextIterator<'a, Self::Vertex>, diff --git a/crates/oxc_query/src/vertex.rs b/crates/oxc_query/src/vertex.rs index be058357e..5bbaad092 100644 --- a/crates/oxc_query/src/vertex.rs +++ b/crates/oxc_query/src/vertex.rs @@ -442,7 +442,6 @@ impl Typename for Vertex<'_> { } } -#[allow(clippy::too_many_lines)] impl<'a> From> for Vertex<'a> { fn from(ast_node: AstNode<'a>) -> Self { match ast_node.kind() { diff --git a/crates/oxc_resolver/src/tests/imports_field.rs b/crates/oxc_resolver/src/tests/imports_field.rs index 0c258e84d..be6f371f1 100644 --- a/crates/oxc_resolver/src/tests/imports_field.rs +++ b/crates/oxc_resolver/src/tests/imports_field.rs @@ -84,7 +84,6 @@ fn imports_field(value: serde_json::Value) -> MatchObject { } #[test] -#[allow(clippy::too_many_lines)] fn test_cases() { let test_cases = [ TestCase {