eslint / typescript-eslint-parser

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

no-implicit-globals regression starting with v21.0.0 #587

Closed scottohara closed 5 years ago

scottohara commented 5 years ago

What version of ESLint are you using? 5.11.1

What version of TypeScript are you using? 3.1.1

What version of typescript-eslint-parser are you using? Any version from 21.0.0 onwards

What code were you trying to parse?

{
  "parser": "typescript-eslint-parser",
  "rules": {
    "func-style": ["error", "declaration"],
    "no-implicit-globals": "error"
  }
}
function foo() {
  return "bar";
}

module.exports = foo;

What did you expect to happen? No errors

What happened? In `typescript-eslint-parser@20.1.1, code passes with no errors.

With `typescript-eslint-parser@21.0.0 onwards, the errors below occur:

1:1  error  Implicit global variable, assign as global property instead  no-implicit-globals
scottohara commented 5 years ago

Note that this error now occurs for both

"parserOptions": { "sourceType": "module" }

and

"parserOptions": { "sourceType": "script" }

armano2 commented 5 years ago

@scottohara sourceType is not used by parser, there is opened PR with that #583

JamesHenry commented 5 years ago

This issue has been migrated to the new project here: typescript-eslint/typescript-eslint#23

Thanks!