Skip to content

Commit ab594f1

Browse files
authored
fix(linter): turn oxc/no-redundant-constructor-init into typescript/no-unnecessary-parameter-property-assignment (#9618)
Closes #9599 I switched the category to nursery because in a followup PR I will import all tests from typescript-eslint and attempt to fix all of them. This separation into two PRs makes the changes easier to review and preserves the history and original author of the lint rule.
1 parent f437a95 commit ab594f1

File tree

41 files changed

+119
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+119
-111
lines changed

apps/oxlint/src/snapshots/_--ignore-path fixtures__linter__.customignore --no-ignore [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory:
1414
help: Use the isNaN function to compare with NaN.
1515
1616
Found 1 warning and 0 errors.
17-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1818
----------
1919
CLI result: LintSucceeded
2020
----------

apps/oxlint/src/snapshots/_--ignore-pattern _____.js --ignore-pattern _____.vue [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: --ignore-pattern **/*.js --ignore-pattern **/*.vue fixtures/linter
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 0 files with 100 rules using 1 threads.
9+
Finished in <variable>ms on 0 files with 99 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_--import-plugin -A all -D no-cycle [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: --import-plugin -A all -D no-cycle fixtures/flow/
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 2 files with 102 rules using 1 threads.
9+
Finished in <variable>ms on 2 files with 101 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_--import-plugin [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: --import-plugin fixtures/flow/index.mjs
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 102 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_--vitest-plugin -c fixtures__eslintrc_vitest_replace__eslintrc.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ working directory:
2323
help: Remove the appending `.skip`
2424
2525
Found 1 warning and 1 error.
26-
Finished in <variable>ms on 1 file with 112 rules using 1 threads.
26+
Finished in <variable>ms on 1 file with 111 rules using 1 threads.
2727
----------
2828
CLI result: LintFoundErrors
2929
----------

apps/oxlint/src/snapshots/_-D correctness [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory:
1414
help: Delete this code.
1515
1616
Found 0 warnings and 1 error.
17-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1818
----------
1919
CLI result: LintFoundErrors
2020
----------

apps/oxlint/src/snapshots/_-W correctness -A no-debugger [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: -W correctness -A no-debugger fixtures/linter/debugger.js
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 98 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_-W no-undef -c fixtures__eslintrc_env__eslintrc_no_env.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ working directory:
1313
`----
1414
1515
Found 1 warning and 0 errors.
16-
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
16+
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
1717
----------
1818
CLI result: LintSucceeded
1919
----------

apps/oxlint/src/snapshots/_-W no-undef -c fixtures__no_undef__eslintrc.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ working directory:
1313
`----
1414
1515
Found 1 warning and 0 errors.
16-
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
16+
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
1717
----------
1818
CLI result: LintSucceeded
1919
----------

apps/oxlint/src/snapshots/_-c fixtures__config_ignore_patterns__ignore_extension__eslintrc.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ working directory:
1212
help: Delete this file or add some code to it.
1313
1414
Found 1 warning and 0 errors.
15-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
15+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1616
----------
1717
CLI result: LintSucceeded
1818
----------

apps/oxlint/src/snapshots/_-c fixtures__eslintrc_env__eslintrc_env_browser.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: -c fixtures/eslintrc_env/eslintrc_env_browser.json fixtures/eslintrc_
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_-c fixtures__eslintrc_off__eslintrc.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ working directory:
1212
help: Delete this file or add some code to it.
1313
1414
Found 1 warning and 0 errors.
15-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
15+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1616
----------
1717
CLI result: LintSucceeded
1818
----------

apps/oxlint/src/snapshots/_-c fixtures__eslintrc_vitest_replace__eslintrc.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: -c fixtures/eslintrc_vitest_replace/eslintrc.json fixtures/eslintrc_v
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_-c fixtures__linter__eslintrc.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory:
1414
help: Delete this code.
1515
1616
Found 0 warnings and 1 error.
17-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1818
----------
1919
CLI result: LintFoundErrors
2020
----------

apps/oxlint/src/snapshots/_-c fixtures__no_console_off__eslintrc.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: -c fixtures/no_console_off/eslintrc.json fixtures/no_console_off/test
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_-c fixtures__no_empty_allow_empty_catch__eslintrc.json -W no-empty [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: -c fixtures/no_empty_allow_empty_catch/eslintrc.json -W no-empty fixt
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_-c fixtures__no_empty_disallow_empty_catch__eslintrc.json -W no-empty [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory:
1414
help: Remove this block or add a comment inside it
1515
1616
Found 1 warning and 0 errors.
17-
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
1818
----------
1919
CLI result: LintSucceeded
2020
----------

apps/oxlint/src/snapshots/_-c fixtures__overrides__.oxlintrc.json fixtures__overrides__test.js -c fixtures__overrides__.oxlintrc.json fixtures__overrides__test.ts -c fixtures__overrides__.oxlintrc.json [email protected]

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ working directory:
1515
help: Replace var with let or const
1616
1717
Found 0 warnings and 1 error.
18-
Finished in <variable>ms on 1 file with 102 rules using 1 threads.
18+
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
1919
----------
2020
CLI result: LintFoundErrors
2121
----------
@@ -42,7 +42,7 @@ working directory:
4242
help: Delete this console statement.
4343
4444
Found 1 warning and 1 error.
45-
Finished in <variable>ms on 1 file with 102 rules using 1 threads.
45+
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
4646
----------
4747
CLI result: LintFoundErrors
4848
----------
@@ -61,7 +61,7 @@ working directory:
6161
help: Replace var with let or const
6262
6363
Found 0 warnings and 1 error.
64-
Finished in <variable>ms on 1 file with 102 rules using 1 threads.
64+
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
6565
----------
6666
CLI result: LintFoundErrors
6767
----------

apps/oxlint/src/snapshots/_-c fixtures__overrides__directories-config.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ working directory:
3535
help: Delete this code.
3636

3737
Found 2 warnings and 2 errors.
38-
Finished in <variable>ms on 7 files with 99 rules using 1 threads.
38+
Finished in <variable>ms on 7 files with 98 rules using 1 threads.
3939
----------
4040
CLI result: LintFoundErrors
4141
----------

apps/oxlint/src/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ working directory:
4343
help: Delete this code.
4444

4545
Found 4 warnings and 0 errors.
46-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
46+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
4747
----------
4848
CLI result: LintSucceeded
4949
----------

apps/oxlint/src/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ working directory:
2828
help: Use the isNaN function to compare with NaN.
2929
3030
Found 3 warnings and 0 errors.
31-
Finished in <variable>ms on 3 files with 100 rules using 1 threads.
31+
Finished in <variable>ms on 3 files with 99 rules using 1 threads.
3232
----------
3333
CLI result: LintSucceeded
3434
----------

apps/oxlint/src/snapshots/_fixtures__linter__debugger.js [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ working directory:
2121
help: Use the isNaN function to compare with NaN.
2222

2323
Found 2 warnings and 0 errors.
24-
Finished in <variable>ms on 2 files with 100 rules using 1 threads.
24+
Finished in <variable>ms on 2 files with 99 rules using 1 threads.
2525
----------
2626
CLI result: LintSucceeded
2727
----------

apps/oxlint/src/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory:
1414
help: Delete this code.
1515
1616
Found 1 warning and 0 errors.
17-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1818
----------
1919
CLI result: LintSucceeded
2020
----------

apps/oxlint/src/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ working directory:
1616
help: Delete this code.
1717

1818
Found 1 warning and 0 errors.
19-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
19+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
2020
----------
2121
CLI result: LintSucceeded
2222
----------

apps/oxlint/src/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ working directory:
2525
help: Delete this code.
2626

2727
Found 2 warnings and 0 errors.
28-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
28+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
2929
----------
3030
CLI result: LintSucceeded
3131
----------

apps/oxlint/src/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: fixtures/vue/empty.vue
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: foo.asdf
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 0 files with 100 rules using 1 threads.
9+
Finished in <variable>ms on 0 files with 99 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory: fixtures/auto_config_detection
1414
help: Delete this code.
1515
1616
Found 0 warnings and 1 error.
17-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1818
----------
1919
CLI result: LintFoundErrors
2020
----------

apps/oxlint/src/snapshots/fixtures__config_ignore_patterns__ignore_directory_-c [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory: fixtures/config_ignore_patterns/ignore_directory
1414
help: Delete this file or add some code to it.
1515
1616
Found 1 warning and 0 errors.
17-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1818
----------
1919
CLI result: LintSucceeded
2020
----------

apps/oxlint/src/snapshots/fixtures__config_ignore_patterns__with_oxlintrc_-c .__test__eslintrc.json --ignore-pattern _.ts [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ working directory: fixtures/config_ignore_patterns/with_oxlintrc
1212
help: Delete this file or add some code to it.
1313
1414
Found 1 warning and 0 errors.
15-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
15+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1616
----------
1717
CLI result: LintSucceeded
1818
----------

apps/oxlint/src/snapshots/fixtures__extends_config_--config extends_rules_config.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory: fixtures/extends_config
1414
help: Delete this console statement.
1515
1616
Found 0 warnings and 1 error.
17-
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
1818
----------
1919
CLI result: LintFoundErrors
2020
----------

apps/oxlint/src/snapshots/fixtures__extends_config_--config relative_paths__extends_extends_config.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory: fixtures/extends_config
1414
help: Delete this console statement.
1515
1616
Found 0 warnings and 1 error.
17-
Finished in <variable>ms on 1 file with 102 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
1818
----------
1919
CLI result: LintFoundErrors
2020
----------

apps/oxlint/src/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory: fixtures/linter
1414
help: Delete this code.
1515
1616
Found 1 warning and 0 errors.
17-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
1818
----------
1919
CLI result: LintSucceeded
2020
----------

apps/oxlint/src/snapshots/fixtures__nested_config_--experimental-nested-config --config [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ working directory: fixtures/nested_config
3737
help: Delete this console statement.
3838

3939
Found 0 warnings and 4 errors.
40-
Finished in <variable>ms on 7 files with 100 rules using 1 threads.
40+
Finished in <variable>ms on 7 files with 99 rules using 1 threads.
4141
----------
4242
CLI result: LintFoundErrors
4343
----------

apps/oxlint/src/snapshots/fixtures__nested_config_--experimental-nested-config -A no-console --config [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: --experimental-nested-config -A no-console --config oxlint-no-console
66
working directory: fixtures/nested_config
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 7 files with 99 rules using 1 threads.
9+
Finished in <variable>ms on 7 files with 98 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/fixtures__output_formatter_diagnostic_--format=default [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ working directory: fixtures/output_formatter_diagnostic
3333
help: Delete this code.
3434
3535
Found 2 warnings and 1 error.
36-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
36+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
3737
----------
3838
CLI result: LintFoundErrors
3939
----------

apps/oxlint/src/snapshots/fixtures__overrides_env_globals_-c .oxlintrc.json [email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ working directory: fixtures/overrides_env_globals
5151
`----
5252

5353
Found 5 warnings and 0 errors.
54-
Finished in <variable>ms on 3 files with 100 rules using 1 threads.
54+
Finished in <variable>ms on 3 files with 99 rules using 1 threads.
5555
----------
5656
CLI result: LintSucceeded
5757
----------

crates/oxc_linter/src/rules.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ mod typescript {
206206
pub mod no_non_null_assertion;
207207
pub mod no_require_imports;
208208
pub mod no_this_alias;
209+
pub mod no_unnecessary_parameter_property_assignment;
209210
pub mod no_unnecessary_type_constraint;
210211
pub mod no_unsafe_declaration_merging;
211212
pub mod no_unsafe_function_type;
@@ -470,7 +471,6 @@ mod oxc {
470471
pub mod no_const_enum;
471472
pub mod no_map_spread;
472473
pub mod no_optional_chaining;
473-
pub mod no_redundant_constructor_init;
474474
pub mod no_rest_spread_properties;
475475
pub mod number_arg_out_of_range;
476476
pub mod only_used_in_recursion;
@@ -858,7 +858,6 @@ oxc_macros::declare_all_lint_rules! {
858858
oxc::no_const_enum,
859859
oxc::no_map_spread,
860860
oxc::no_optional_chaining,
861-
oxc::no_redundant_constructor_init,
862861
oxc::no_rest_spread_properties,
863862
oxc::number_arg_out_of_range,
864863
oxc::only_used_in_recursion,
@@ -943,6 +942,7 @@ oxc_macros::declare_all_lint_rules! {
943942
typescript::no_non_null_assertion,
944943
typescript::no_require_imports,
945944
typescript::no_this_alias,
945+
typescript::no_unnecessary_parameter_property_assignment,
946946
typescript::no_unnecessary_type_constraint,
947947
typescript::no_unsafe_declaration_merging,
948948
typescript::no_unsafe_function_type,

0 commit comments

Comments
 (0)