Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
fix(typescript-estree, eslint-plugin): stop adding ParenthesizedExpressions to node maps#226
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
fix(typescript-estree, eslint-plugin): stop adding ParenthesizedExpressions to node maps#226
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecovbot commentedFeb 7, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## master #226 +/- ##==========================================+ Coverage 96.78% 96.79% +<.01%========================================== Files 56 56 Lines 2522 2524 +2 Branches 372 373 +1 ==========================================+ Hits 2441 2443 +2 Misses 42 42 Partials 39 39
|
armano2 left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 way better solution than mine, good catch,
besides this small note LGTM
Uh oh!
There was an error while loading.Please reload this page.
codecovbot commentedFeb 7, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## master #226 +/- ##==========================================+ Coverage 96.78% 96.79% +<.01%========================================== Files 56 56 Lines 2522 2525 +3 Branches 372 374 +2 ==========================================+ Hits 2441 2444 +3 Misses 42 42 Partials 39 39
|
Failing from line ending issues in the fixture |
packages/eslint-plugin/lib/rules/no-unnecessary-type-assertion.js OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…int#226)### Disallow `/// <reference path="" />` commentsbut it's triggered on:- `/// <reference types="foo" />`- `/// <reference lib="es2017.string" />`- `/// <reference no-default-lib="true"/>`types/lib/no-default-lib can't be replaced by es6 imports
Uh oh!
There was an error while loading.Please reload this page.
Builds off#212
The core issue for the crashes is that the TS AST has individual nodes for parenthesized expressions, but the ESTree AST does not.
Assuming a tree of the form
(E)
, whereE
is some expression, we would map the TS version ofE
to the ESTree version ofE
, but the ESTree version ofE
would map to the TS version of(E)
, thereby causing the missingtype
property in the repro.This PR makes it so we don't add TS nodes of type
ParenthesizedExpression
to the ES->TS map.I also moved some things around in the particular rule you were investigating; in particular, there's no good reason for us to use the TS node to get the text to check against the provided options, so I switched it to using the ESTree node.
fixes:#187