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

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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)