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): eslint-plugin-import with built-in module resolution #530

Closed
wants to merge 1 commit into from

Conversation

Boshen
Copy link
Member

@Boshen Boshen commented Jul 9, 2023

This PR has several parts:

  • copies import plugins' test suite over
  • moves all existing lint runners from the cli into the linter
  • creates the import/named rule to get the test driver working

Things left to do:

  • only lint the files that come from the directory walk, all external dependencies should not be linted nor syntax checked
  • test in real repos with black holes (node_modules) installed
  • have some kind of mechanism to keep max memory down
  • this is 5 times slower than the existing implementation, need to profile where the bottlenecks are
  • profile for unnecessary memory allocations
  • compile to wasm

@Boshen Boshen force-pushed the import-plugin branch 2 times, most recently from a2eb46a to 1182477 Compare July 9, 2023 14:54
@Boshen Boshen changed the title feat(linter): import plugin and new lint runner feat(linter): eslint-plugin-import with built-in module resolution Jul 9, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2023

Benchmark Results

Linux

group                            main                                   pr
-----                            ----                                   --
minifier/antd.js                 1.00   295.9±10.24ms    21.6 MB/sec    1.03    305.1±6.92ms    20.9 MB/sec
minifier/react.development.js    1.00      3.1±0.14ms    22.4 MB/sec    1.02      3.1±0.15ms    22.1 MB/sec
minifier/typescript.js           1.00   500.0±14.73ms    20.6 MB/sec    1.03   512.8±13.46ms    20.1 MB/sec
minifier/vue.js                  1.01     20.6±1.32ms    15.8 MB/sec    1.00     20.3±1.09ms    16.1 MB/sec
parser/antd.js                   1.00     83.7±4.94ms    76.2 MB/sec    1.08     90.4±4.11ms    70.6 MB/sec
parser/react.development.js      1.00   898.4±42.87µs    76.6 MB/sec    1.10   992.1±27.42µs    69.3 MB/sec
parser/typescript.js             1.00    138.8±5.85ms    74.3 MB/sec    1.10    153.1±5.08ms    67.4 MB/sec
parser/vue.js                    1.00      6.0±0.45ms    54.2 MB/sec    1.08      6.5±0.18ms    50.2 MB/sec
semantic/antd.js                 1.00     99.3±5.72ms    64.2 MB/sec    1.04    103.3±5.75ms    61.7 MB/sec
semantic/react.development.js    1.00   915.0±43.80µs    75.2 MB/sec    1.11  1011.5±39.48µs    68.0 MB/sec
semantic/typescript.js           1.00   218.3±14.84ms    47.2 MB/sec    1.03   224.0±10.82ms    46.1 MB/sec
semantic/vue.js                  1.00      6.1±0.37ms    53.6 MB/sec    1.19      7.3±0.57ms    45.0 MB/sec

Windows

group                            main                                   pr
-----                            ----                                   --
minifier/antd.js                 1.07   468.9±22.04ms    13.6 MB/sec    1.00   437.7±16.67ms    14.6 MB/sec
minifier/react.development.js    1.07      4.4±0.33ms    15.6 MB/sec    1.00      4.1±0.16ms    16.6 MB/sec
minifier/typescript.js           1.01   699.6±24.06ms    14.7 MB/sec    1.00   692.5±21.81ms    14.9 MB/sec
minifier/vue.js                  1.14     29.5±2.30ms    11.0 MB/sec    1.00     25.8±1.26ms    12.6 MB/sec
parser/antd.js                   1.00    110.2±5.72ms    57.9 MB/sec    1.02    112.1±4.59ms    56.9 MB/sec
parser/react.development.js      1.00  1122.1±44.48µs    61.3 MB/sec    1.02  1143.5±47.93µs    60.2 MB/sec
parser/typescript.js             1.00    181.6±7.57ms    56.8 MB/sec    1.01    184.2±6.98ms    56.0 MB/sec
parser/vue.js                    1.00      7.2±0.27ms    45.1 MB/sec    1.02      7.3±0.20ms    44.4 MB/sec
semantic/antd.js                 1.04   161.5±12.32ms    39.5 MB/sec    1.00    155.9±5.83ms    40.9 MB/sec
semantic/react.development.js    1.01  1414.1±70.20µs    48.7 MB/sec    1.00  1394.4±45.03µs    49.3 MB/sec
semantic/typescript.js           1.00   330.4±22.10ms    31.2 MB/sec    1.00   330.4±17.22ms    31.2 MB/sec
semantic/vue.js                  1.09      9.9±0.84ms    32.8 MB/sec    1.00      9.2±0.38ms    35.7 MB/sec

@Boshen Boshen marked this pull request as draft July 10, 2023 02:47
@Boshen
Copy link
Member Author

Boshen commented Jul 10, 2023

image

Performance is really bad with nodejs-resolver.

Boshen added a commit that referenced this pull request Jul 31, 2023
This code will eventually be superseded by
#530, removing this for now so
others don't have to touch this.
@Boshen Boshen closed this Sep 7, 2023
@Boshen Boshen deleted the import-plugin branch March 25, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant