Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I haveread the FAQ and my problem is not listed.
Repro
# Clone typescript-eslint into current directorygit clone https://github.com/typescript-eslint/typescript-eslintcd typescript-eslint# Install packages to increase number of files and subfolders in the directoryyarn install# Lint ESLint rules with enabled debugging and pass tsconfig.json to project option via glob patterneslint packages\eslint-plugin\src\rules --parser-options debugLevel:true,project:**/packages/eslint-plugin/tsconfig.json
Expected Result
Linting with glob pattern should take similar time as when tsconfig.json is passed directly via relative path.
eslint typescript-eslint\packages\eslint-plugin\src\rules --parser-options debugLevel:true,project:packages/eslint-plugin/tsconfig.json
Output:
typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +0ms typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\adjacent-overload-signatures.ts +0ms typescript-eslint:typescript-estree:createWatchProgram File did not belong to any existing programs, moving to create/update. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\adjacent-overload-signatures.ts +0ms typescript-eslint:typescript-estree:createWatchProgram Creating watch program for c:\src\github.com\typescript-eslint\packages\eslint-plugin\tsconfig.json. +7ms typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +0ms typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +5s typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\array-type.ts +5s typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\array-type.ts +5s typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +328ms typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +722ms typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\await-thenable.ts +722ms typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\await-thenable.ts +713ms typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +684ms typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +169ms... typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\typedef.ts +93ms typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\typedef.ts +95ms typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +89ms typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +141ms typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\unbound-method.ts +142ms typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\unbound-method.ts +141ms typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +141ms typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +131ms typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\unified-signatures.ts +130ms typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\unified-signatures.ts +130ms typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +142ms
Actual Result
Parser seems to be resolving glob pattern for every linted file individually which significantly increases time to finish the scan.
eslint packages\eslint-plugin\src\rules --parser-options debugLevel:true,project:**/packages/eslint-plugin/tsconfig.json
Output:
typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +0ms typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\adjacent-overload-signatures.ts +0ms typescript-eslint:typescript-estree:createWatchProgram File did not belong to any existing programs, moving to create/update. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\adjacent-overload-signatures.ts +0ms typescript-eslint:typescript-estree:createWatchProgram Creating watch program for c:\src\github.com\typescript-eslint\packages\eslint-plugin\tsconfig.json. +0ms typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +0ms typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +11s typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\array-type.ts +11s typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\array-type.ts +11s typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +5s typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +3s typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\await-thenable.ts +3s typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\await-thenable.ts +3s typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +3s typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +3s... typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\typedef.ts +3s typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\typedef.ts +3s typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +3s typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +3s typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\unbound-method.ts +3s typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\unbound-method.ts +3s typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +3s typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: [ 'packages/eslint-plugin/tsconfig.json' ] +4s typescript-eslint:typescript-estree:createProjectProgram Creating project program for: c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\unified-signatures.ts +4s typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. c:\src\github.com\typescript-eslint\packages\eslint-plugin\src\rules\unified-signatures.ts +4s typescript-eslint:parser:parser Resolved libs from program: [ 'es2017' ] +4s
Additional Info
Until the issue is investigated and fixed we were suggesting adding a note in the documentation to warn users -#2602
Versions
package | version |
---|---|
@typescript-eslint/typescript-estree | 4.3.0 |
TypeScript | 4.0.2 |
node | 14.6.0 |