EvgenyOrekhov / eslint-config-hardcore

The most strict (yet practical) ESLint config. 53 plugins. 1342 rules. React, Vue, Node, and pure JS/TS.
https://www.npmjs.com/package/eslint-config-hardcore
MIT License
405 stars 13 forks source link

[Question] Slow performance issue #881

Open Shuunen opened 5 months ago

Shuunen commented 5 months ago

Hi there :)

Thanks for your project, I really like the meta plugin aspect, the only thing is I'm surprised to see so much delay to process a single file,

I made a super simple TS project that use hardcore & typescript : https://github.com/Shuunen/minimal-ts-hardcore

Is it normal to take 7 seconds for a single file ?

Am I missing something ?

Thanks

qweered commented 5 months ago

I also encountered slow performance, after disabling some rule it improves a lot

Shuunen commented 5 months ago

@qweered What's the performance you have after disabling these rules?

qweered commented 5 months ago

@qweered What's the performance you have after disabling these rules?

Its like down from 12 seconds to 5, I disable some typescript eslint rule, cannot remember more

EvgenyOrekhov commented 5 months ago

You can use TIMING=1 to see slow rules:

❯ TIMING=1 npx eslint main.ts
Rule                                                  | Time (ms) | Relative
:-----------------------------------------------------|----------:|--------:
etc/no-deprecated                                     |    97.867 |    30.3%
putout/putout                                         |    83.454 |    25.8%
compat/compat                                         |    59.005 |    18.3%
import/no-unused-modules                              |    25.591 |     7.9%
total-functions/no-unsafe-readonly-mutable-assignment |     3.903 |     1.2%
@typescript-eslint/naming-convention                  |     3.715 |     1.1%
import/no-extraneous-dependencies                     |     3.710 |     1.1%
decorator-position/decorator-position                 |     2.488 |     0.8%
@typescript-eslint/promise-function-async             |     2.064 |     0.6%
@typescript-eslint/no-redeclare                       |     1.834 |     0.6%
Shuunen commented 5 months ago

You can use TIMING=1 to see slow rules:


❯ TIMING=1 npx eslint main.ts

Yes I used this and file types overrides to improve performance, but still I'd like to improve the time spent, I will try to fork this repo to try to embed less plugins, see if it does the same as disabling these slow rules