Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(linter): add dangerous fixer for oxc only used in recursion #4805

Conversation

camc314
Copy link
Contributor

@camc314 camc314 commented Aug 10, 2024

No description provided.

Copy link

graphite-app bot commented Aug 10, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@camc314 camc314 marked this pull request as ready for review August 10, 2024 09:59
Copy link
Contributor Author

camc314 commented Aug 10, 2024

Copy link

codspeed-hq bot commented Aug 10, 2024

CodSpeed Performance Report

Merging #4805 will not alter performance

Comparing c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion (915cb4d) with main (4cb8c37)

Summary

✅ 29 untouched benchmarks

@mysteryven mysteryven changed the base branch from c/08-10-feat_linter_add_fixer_for_unicorn_prefer-string-replace-all to graphite-base/4805 August 10, 2024 14:46
@mysteryven mysteryven force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch from c9f6429 to 904ffaa Compare August 10, 2024 14:48
@mysteryven mysteryven changed the base branch from graphite-base/4805 to main August 10, 2024 14:49
@mysteryven mysteryven added the 0-merge Merge with Graphite Merge Queue label Aug 10, 2024 — with Graphite App
@camc314 camc314 marked this pull request as draft August 10, 2024 16:06
@camc314 camc314 removed the 0-merge Merge with Graphite Merge Queue label Aug 10, 2024
@camc314
Copy link
Contributor Author

camc314 commented Aug 10, 2024

Currently,

test(a, b)

function test(a,b) {
test(a,b)

will be transformed to:

test(a, b)

function test(a) {
test(a)

which isn't good. I am going to:

  1. disable the dangerous fix when the function is exported
  2. update the fixer so that we remove the argument everywhere it is invoked

Edit:i thought about it more, and maybe doing 1 is ok as this is a dangerous suggestion? what do you all think?

@camc314 camc314 dismissed mysteryven’s stale review August 10, 2024 16:18

making changes

@camc314 camc314 force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch 2 times, most recently from d2109e9 to 7e97957 Compare August 10, 2024 16:47
@camc314 camc314 marked this pull request as ready for review August 10, 2024 16:51
@camc314 camc314 force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch from 7e97957 to 3e73d2e Compare August 10, 2024 20:31
@camc314 camc314 changed the base branch from main to c/08-10-feat_linter_support_arrow_functions_in_oxc_only_used_in_recursion August 10, 2024 20:31
@camc314 camc314 force-pushed the c/08-10-feat_linter_support_arrow_functions_in_oxc_only_used_in_recursion branch from 5d3be09 to 0c179dd Compare August 10, 2024 21:07
@camc314 camc314 force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch from 3e73d2e to c048379 Compare August 10, 2024 21:08
@camc314 camc314 force-pushed the c/08-10-feat_linter_support_arrow_functions_in_oxc_only_used_in_recursion branch from 0c179dd to 4e01e3f Compare August 11, 2024 08:53
@camc314 camc314 force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch from c048379 to 0326085 Compare August 11, 2024 08:53
@camc314 camc314 force-pushed the c/08-10-feat_linter_support_arrow_functions_in_oxc_only_used_in_recursion branch from 57b7d87 to 61980d4 Compare August 11, 2024 12:40
@camc314 camc314 force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch from 0326085 to 61a29db Compare August 11, 2024 12:40
@camc314 camc314 force-pushed the c/08-10-feat_linter_support_arrow_functions_in_oxc_only_used_in_recursion branch from 61980d4 to 753887e Compare August 11, 2024 12:42
@camc314 camc314 force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch from 61a29db to 380718c Compare August 11, 2024 12:42
@DonIsaac DonIsaac changed the base branch from c/08-10-feat_linter_support_arrow_functions_in_oxc_only_used_in_recursion to graphite-base/4805 August 11, 2024 12:50
@DonIsaac DonIsaac force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch from 380718c to 7a324a1 Compare August 11, 2024 12:53
@DonIsaac DonIsaac force-pushed the graphite-base/4805 branch from 753887e to 4e818a4 Compare August 11, 2024 12:53
@DonIsaac DonIsaac changed the base branch from graphite-base/4805 to main August 11, 2024 12:54
@camc314
Copy link
Contributor Author

camc314 commented Aug 11, 2024

@DonIsaac mind taking another look when you've time?

@DonIsaac
Copy link
Contributor

Currently,

test(a, b)

function test(a,b) {
test(a,b)

will be transformed to:

test(a, b)

function test(a) {
test(a)

which isn't good. I am going to:

  1. disable the dangerous fix when the function is exported
  2. update the fixer so that we remove the argument everywhere it is invoked

Edit:i thought about it more, and maybe doing 1 is ok as this is a dangerous suggestion? what do you all think?

A dangerous suggestion sounds good. Suggestion implies a possible change to program semantics, and dangerous implies it could break things.

@DonIsaac
Copy link
Contributor

@camc314 any updates on this PR?

@DonIsaac DonIsaac added the C-enhancement Category - New feature or request label Aug 15, 2024
@camc314 camc314 force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch 3 times, most recently from 3fd15a1 to 4a8552b Compare August 16, 2024 10:59
@camc314
Copy link
Contributor Author

camc314 commented Aug 16, 2024

Hey, sorry. this one should be ready for review

@camc314 camc314 force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch from 4a8552b to f3fb4f6 Compare August 17, 2024 12:02
@mysteryven mysteryven added the 0-merge Merge with Graphite Merge Queue label Aug 18, 2024
Copy link

graphite-app bot commented Aug 18, 2024

Merge activity

  • Aug 17, 9:19 PM EDT: The merge label 'merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 17, 9:19 PM EDT: mysteryven added this pull request to the Graphite merge queue.
  • Aug 17, 9:22 PM EDT: mysteryven merged this pull request with the Graphite merge queue.

@mysteryven mysteryven force-pushed the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch from f3fb4f6 to 915cb4d Compare August 18, 2024 01:19
@graphite-app graphite-app bot merged commit 915cb4d into main Aug 18, 2024
24 checks passed
@graphite-app graphite-app bot deleted the c/08-10-feat_linter_add_dangerous_fixer_for_oxc_only_used_in_recursion branch August 18, 2024 01:22
@oxc-bot oxc-bot mentioned this pull request Aug 23, 2024
Boshen added a commit that referenced this pull request Aug 23, 2024
## [0.8.0] - 2024-08-23

- 5f4c9ab semantic: [**BREAKING**] Rename `SymbolTable::get_flag` to
`get_flags` (#5030) (overlookmotel)

- ce4d469 codegen: [**BREAKING**] Remove const generic `MINIFY` (#5001)
(Boshen)

- b2ff2df parser: [**BREAKING**] Remove builder pattern from `Parser`
struct (#5000) (Boshen)

- f88970b ast: [**BREAKING**] Change order of fields in CallExpression
(#4859) (Burlin)

### Features

- 2292606 linter: Typescript-eslint/no-wrapper-object-types (#5022)
(camc314)
- a0effab linter: Support more flexible config.globals values (#4990)
(Don Isaac)
- cdbfcfb linter: Start import fixer for eslint/no-unused-vars (#4849)
(DonIsaac)
- 915cb4d linter: Add dangerous fixer for oxc only used in recursion
(#4805) (camc314)
- 3f28c77 linter/eslint: Improve no-dupe-keys (#4943) (DonIsaac)
- e1582a5 linter/eslint: Improve no-duplicate-case rule (#4942)
(DonIsaac)
- f1e4611 linter/eslint-plugin-vitest: Implement no-conditional-in-test
(#4971) (dalaoshu)
- 14bf5d5 linter/eslint-plugin-vitest: Implement
no-restricted-vi-methods (#4956) (dalaoshu)
- ed9a1c4 linter/eslint-plugin-vitest: Implement
require-local-test-context-for-concurrent-snapshots (#4951) (dalaoshu)
- 7859f58 linter/eslint-plugin-vitest: Implement no-conditional-tests
(#4955) (dalaoshu)
- 841174f linter/no-unused-vars: Delete non-root arrows, skip `await`
(#5083) (Don Isaac)

### Bug Fixes

- 86d0c0c linter: Change consistent-function-scoping to suspicious
(#5010) (DonIsaac)
- 7b99386 linter: Missing closing ticks in some example blocks (#4994)
(DonIsaac)
- 9c64b12 linter: Improve no-zero-fractions rule for member expressions
and scientific notation (#4793) (Burlin)
- c43945c linter/consistent-function-scoping: Allow functions passed as
arguments (#5011) (Don Isaac)
- 9354779 linter/no-unused-vars: Give `argsIgnorePattern` the same
default behavior as `varsIgnorePattern` (#5018) (DonIsaac)
- 5a55dcf linter/no-unused-vars: `type` specifier not deleted for type
imports (#5029) (DonIsaac)
- 4081293 linter/no-unused-vars: Panic in fixer when removing
destructures (#4923) (Don Isaac)
- ddf83ff linter/react: Fixed false positive with missing key inside
React.Children.toArray() (#4945) (Earl Chase)
- 508644a linter/tree-shaking: Correct the calculation of `>>`, `<<` and
`>>>` (#4932) (mysteryven)
- e99836d linter/unicorn: Allow set spreading in no-useless-spread
(#4944) (Don Isaac)
- 5f8a7c2 oxlint: Rules in the configuration file are not being
correctly … (#4949) (dalaoshu)

### Documentation

- e331ca0 linter: Improve documentation for several rules (#4997)
(DonIsaac)
- cd9f1cd linter/consistent-function-scoping: Improve rule documentation
(#5015) (DonIsaac)

### Refactor

- eca6fdb linter: Move plugin options into separate struct (#5100)
(DonIsaac)
- 06f2d81 linter: Avoid unnecessary temp `Vec`s (#4963) (overlookmotel)
- 4cb8c37 linter: Move default_true to utils (#4947) (Don Isaac)
- ca70cc7 linter, mangler, parser, semantic, transformer, traverse,
wasm: Rename various `flag` vars to `flags` (#5028) (overlookmotel)
- 59d15c7 semantic: `root_unresolved_references` contain only
`ReferenceId` (#4959) (overlookmotel)

### Testing

- c21d735 linter/no-unused-vars: Add ignored destructuring test cases
(#4922) (Don Isaac)

Co-authored-by: Boshen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-linter Area - Linter C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants