eslint / typescript-eslint-parser

An ESLint custom parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code.
Other
915 stars 92 forks source link

asExpression unwanted error #563

Closed AdrienLemaire closed 5 years ago

AdrienLemaire commented 5 years ago

Related to #25

What version of TypeScript are you using? 3.1.6

What version of typescript-eslint-parser are you using? 21.0.1

What code were you trying to parse?

interface CustomWindow extends Window {
  gtmDataLayer?: any;
}

…
      (window as CustomWindow).gtmDataLayer.push({
        event: "Registration started",
        provider,
      });

What did you expect to happen? No error shown in vim, similarly to tsc reportt

$ yarn type-check
yarn run v1.12.3
$ tsc --project tsconfig.json
Done in 3.81s.

What happened?

I spent hours thinking that the code above was incorrect because of that error before realizing that tsc didn't raise errors on this code.

The problem is that my git hook fails with the eslint error, and that's not an error I can eslint-disable..

AdrienLemaire commented 5 years ago

Sorry about that. We're not using the typescript-eslint-parser but babel-eslint