A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/typescript-eslint/typescript-eslint/issues/2611 below:

Glob pattern in parser's option "project" slows down linting · Issue #2611 · typescript-eslint/typescript-eslint · GitHub

Repro

# Clone typescript-eslint into current directory
git clone https://github.com/typescript-eslint/typescript-eslint
cd typescript-eslint
# Install packages to increase number of files and subfolders in the directory
yarn install
# Lint ESLint rules with enabled debugging and pass tsconfig.json to project option via glob pattern
eslint 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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4