Skip to content

chore(eslint-plugin): add a debug log when a type is an "error" any to help with investigations #2226

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

Merged
merged 1 commit into from
Jun 19, 2020

Conversation

bradzacher
Copy link
Member

@bradzacher bradzacher commented Jun 19, 2020

This is just to help us investigate bugs that people report.
Sometimes the type fails to resolve, causing it to be reported as an any.
TS also adds a property to these anys - intrinsicName: "error" (example: https://ts-ast-viewer.com/#code/C4TwDgpgBAGlC8UCuA7A1ig9gdxaSA3EA)

Being able to see what's an any can often help in debugging issues - if it's an "error any", then it's not a bug in our code, but instead a problem with the user's setup.

I used to manually patch node_modules on repro repos to log it out, but it's probably better if it's just built into the plugin instead.

@bradzacher bradzacher added the enhancement New feature or request label Jun 19, 2020
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@codecov
Copy link

codecov bot commented Jun 19, 2020

Codecov Report

Merging #2226 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2226   +/-   ##
=======================================
  Coverage   93.39%   93.39%           
=======================================
  Files         174      174           
  Lines        7883     7890    +7     
  Branches     2251     2254    +3     
=======================================
+ Hits         7362     7369    +7     
  Misses        247      247           
  Partials      274      274           
Flag Coverage Δ
#unittest 93.39% <100.00%> (+<0.01%) ⬆️
Impacted Files Coverage Δ
packages/eslint-plugin/src/rules/await-thenable.ts 100.00% <100.00%> (ø)
...ckages/eslint-plugin/src/rules/no-throw-literal.ts 96.07% <100.00%> (ø)
...slint-plugin/src/rules/no-unnecessary-condition.ts 97.31% <100.00%> (ø)
...-plugin/src/rules/restrict-template-expressions.ts 100.00% <100.00%> (ø)
...int-plugin/src/rules/strict-boolean-expressions.ts 97.77% <100.00%> (ø)
packages/eslint-plugin/src/util/types.ts 82.08% <100.00%> (+0.86%) ⬆️

@bradzacher bradzacher merged commit 89851fa into master Jun 19, 2020
@bradzacher bradzacher deleted the debug-log-for-error-any branch June 19, 2020 18:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant