angular-cli: ng lint 10x slower than direct tslint
OS?
OS X Sierra
Versions.
@angular/cli: 1.0.0-beta.31
node: 6.9.1
os: darwin x64
@angular/cli: 1.0.0-beta.31
@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7
@angular/compiler-cli: 2.4.7
Repro steps.
Using a reasonably large repo with these package.json scripts:
"lint": "ng lint",
"tslint": "tslint \"src/**/*.ts\"",
I get the following runtimes:
iDevBook01:console jr$ time npm run tslint
> meshstack-console@0.0.0 tslint /Users/jr/dev/console/console
> tslint "src/**/*.ts"
no-unused-variable is deprecated. Use the tsc compiler options --noUnusedParameters and --noUnusedLocals instead.
real 0m16.808s
user 0m17.005s
sys 0m0.748s
iDevBook01:console jr$ time npm run lint
> meshstack-console@0.0.0 lint /Users/jr/dev/console/console
> ng lint
no-unused-variable is deprecated. Use the tsc compiler options --noUnusedParameters and --noUnusedLocals instead.
All files pass linting.
real 1m49.394s
user 1m49.213s
sys 0m1.437s
The log given by the failure.
I have no idea why ng lint
should take so absurdly long compared to vanilla tslint
. I’m using the standard tslint.json generated by ng init
and "codelyzer": "^2.0.0"
(also tried with 2.0.0-beta.4, no change).
Mention any other details that might be useful.
Any idea where the difference comes from? Any input I can provide to debug this?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (8 by maintainers)
@filipesilva if you have the time to try, you can always experiment with a project like the one I’m working on (https://gitlab.com/linagora/petals-cockpit, run ng lint from the
frontend
directory) and compare with the tslint timings. There is a big difference:@victornoel generally it’s discouraged to ship TypeScript with third party libraries because it would require the consumer to replicate the complete build environment of the library. Not only typings, but potentially a specific version of
ngc
as well.Publishing plain JavaScript with typings and meta data allows the consuming application to remain agnostic of the library’s build environment.
@filipesilva thanks for detailed explanation 😃