-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(typescript-estree): add parserOption to turn on debug logs #1413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
are you planning to add some tests for this?
The problem is that it's pretty hard to test this, as the code is buried pretty deep in the stack. |
# Conflicts: # packages/typescript-estree/src/create-program/shared.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is few small things in doc that are no longer correct, i know that it's already merged
/* | ||
* enable parsing JSX. For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html | ||
/** | ||
* The absolute path to the file being parsed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not fully true anymore, relative paths are working to they are converted to cwd + path
extraFileExtensions?: string[]; | ||
|
||
/** | ||
* The absolute path to the file being parsed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* The absolute path to the file being parsed. | |
* Absolute (or relative to `tsconfigRootDir`) path to the file being parsed. |
From the cli you can do
DEBUG=typescript-eslint:*,eslint:*
and it'll turn on all debug logging.However, when debugging things running in an eslint IDE extension, it's hard to get debug information, which can make it really hard to trace bugs.
It's relatively easy for maintainers to go and edit the files in
node_modules
, but it's not really a good experience to ask issue reporters to do the same to give us logs.This just adds the following parserOption
debugLevel?: boolean | ('typescript-eslint' | 'eslint' | 'typescript')[]
Which lets you turn on debug logging for all of the relevant modules. I opted for an array instead of a number so it's more explicit and easier to fine tune, because each of the modules can dump a tonne of logs.