Skip to content

Commit 115cae5

Browse files
feat: --debug prints time it takes to parse a file (#15609)
* feat: --debug prints time it takes to parse a file * Update lib/linter/linter.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * add separate logs for parsing and scope analysis * lint Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
1 parent 345e70d commit 115cae5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/linter/linter.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,14 +800,21 @@ function parse(text, languageOptions, filePath) {
800800
* problem that ESLint identified just like any other.
801801
*/
802802
try {
803+
debug("Parsing:", filePath);
803804
const parseResult = (typeof parser.parseForESLint === "function")
804805
? parser.parseForESLint(textToParse, parserOptions)
805806
: { ast: parser.parse(textToParse, parserOptions) };
807+
808+
debug("Parsing successful:", filePath);
806809
const ast = parseResult.ast;
807810
const parserServices = parseResult.services || {};
808811
const visitorKeys = parseResult.visitorKeys || evk.KEYS;
812+
813+
debug("Scope analysis:", filePath);
809814
const scopeManager = parseResult.scopeManager || analyzeScope(ast, languageOptions, visitorKeys);
810815

816+
debug("Scope analysis successful:", filePath);
817+
811818
return {
812819
success: true,
813820

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy