+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Conversation

IWANABETHATGUY
Copy link
Contributor

@IWANABETHATGUY IWANABETHATGUY commented Jul 30, 2022

Summary

  1. Resolved 📎 (rome_js_analyze): noDupeArgs #2735

Test Plan

  1. Should pass all test cases newly added.

@IWANABETHATGUY
Copy link
Contributor Author

Wait #2973 to be merged.

@IWANABETHATGUY IWANABETHATGUY changed the title feat(rome_js_analyze): useDupeArgs feat(rome_js_analyze):noDupeArgs Jul 31, 2022
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review July 31, 2022 04:25
@IWANABETHATGUY IWANABETHATGUY requested a review from a team July 31, 2022 04:25
@IWANABETHATGUY
Copy link
Contributor Author

!bench_analyhzer

@IWANABETHATGUY
Copy link
Contributor Author

!bench_analyzer

@github-actions
Copy link

Analyzer Benchmark Results

group                     main                                   pr
-----                     ----                                   --
analyzer/css.js           1.00      2.3±0.00ms     4.9 MB/sec    1.02      2.4±0.00ms     4.9 MB/sec
analyzer/index.js         1.00      5.6±0.01ms     5.8 MB/sec    1.02      5.7±0.06ms     5.6 MB/sec
analyzer/lint.ts          1.00      3.2±0.00ms    12.8 MB/sec    1.02      3.3±0.00ms    12.6 MB/sec
analyzer/parser.ts        1.00      7.5±0.01ms     6.5 MB/sec    1.01      7.5±0.04ms     6.4 MB/sec
analyzer/router.ts        1.00      5.2±0.01ms    11.7 MB/sec    1.01      5.3±0.01ms    11.6 MB/sec
analyzer/statement.ts     1.00      7.1±0.03ms     5.0 MB/sec    1.01      7.2±0.03ms     4.9 MB/sec
analyzer/typescript.ts    1.00     10.5±0.08ms     5.2 MB/sec    1.01     10.6±0.02ms     5.1 MB/sec

@ematipico ematipico changed the title feat(rome_js_analyze):noDupeArgs feat(rome_js_analyze): rule noDupeArgs Aug 2, 2022
@IWANABETHATGUY IWANABETHATGUY force-pushed the feat/no-dupe-args branch 2 times, most recently from 5894c1d to e1fe0db Compare August 6, 2022 13:32
@IWANABETHATGUY
Copy link
Contributor Author

!bench_analyzer

@github-actions
Copy link

Analyzer Benchmark Results

group                     main                                   pr
-----                     ----                                   --
analyzer/css.js           1.00      2.5±0.09ms     4.7 MB/sec    1.06      2.6±0.02ms     4.5 MB/sec
analyzer/index.js         1.00      6.7±0.13ms     4.8 MB/sec    1.05      7.1±0.31ms     4.6 MB/sec
analyzer/lint.ts          1.02      3.5±0.06ms    11.8 MB/sec    1.00      3.5±0.10ms    12.0 MB/sec
analyzer/parser.ts        1.00      8.1±0.13ms     6.0 MB/sec    1.04      8.4±0.10ms     5.8 MB/sec
analyzer/router.ts        1.05      5.8±0.10ms    10.6 MB/sec    1.00      5.5±0.18ms    11.1 MB/sec
analyzer/statement.ts     1.03      8.0±0.11ms     4.4 MB/sec    1.00      7.8±0.19ms     4.6 MB/sec
analyzer/typescript.ts    1.02     11.8±0.43ms     4.6 MB/sec    1.00     11.6±0.32ms     4.7 MB/sec

@IWANABETHATGUY
Copy link
Contributor Author

@ematipico I rewrite the algorithm as you said before, using a recursive pattern matching algorithm to find the duplicate params. Would you mind helping with reviewing?

@leops
Copy link
Contributor

leops commented Aug 11, 2022

So this may be more of a discussion we could have in the corresponding issue for this rule rather than in the PR, but I'm wondering if there's a way we could make the implementation for this rule more generic, into a noNameShadowing rule that would disallow duplicate binding names in the same scope whether that's two arguments, variables, functions, object / class member ...

@IWANABETHATGUY
Copy link
Contributor Author

!bench_analyzer

@github-actions
Copy link

Analyzer Benchmark Results

group                     main                                   pr
-----                     ----                                   --
analyzer/css.js           1.00   1929.8±6.90µs     6.0 MB/sec    1.01   1943.3±6.87µs     6.0 MB/sec
analyzer/index.js         1.00      5.2±0.05ms     6.2 MB/sec    1.01      5.3±0.03ms     6.1 MB/sec
analyzer/lint.ts          1.00      2.8±0.04ms    14.9 MB/sec    1.00      2.8±0.03ms    14.9 MB/sec
analyzer/parser.ts        1.00      6.6±0.15ms     7.4 MB/sec    1.00      6.5±0.13ms     7.4 MB/sec
analyzer/router.ts        1.13      5.2±0.10ms    11.8 MB/sec    1.00      4.6±0.10ms    13.3 MB/sec
analyzer/statement.ts     1.00      6.2±0.12ms     5.7 MB/sec    1.16      7.2±0.35ms     4.9 MB/sec
analyzer/typescript.ts    1.01      9.2±0.12ms     5.9 MB/sec    1.00      9.1±0.08ms     6.0 MB/sec

Copy link
Contributor

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xunilrj would you mind a give a second view and merge if you think it's fine?

@xunilrj
Copy link
Contributor

xunilrj commented Aug 22, 2022

@xunilrj would you mind a give a second view and merge if you think it's fine?

Done.

@xunilrj xunilrj merged commit 4ca30ed into rome:main Aug 22, 2022
@IWANABETHATGUY IWANABETHATGUY deleted the feat/no-dupe-args branch August 22, 2022 08:07
IWANABETHATGUY added a commit to IWANABETHATGUY/tools that referenced this pull request Aug 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

📎 (rome_js_analyze): noDupeArgs

5 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载