Skip to content

Class extends value undefined is not a constructor or null #2104

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

Closed
cawoodm opened this issue May 25, 2020 · 1 comment
Closed

Class extends value undefined is not a constructor or null #2104

cawoodm opened this issue May 25, 2020 · 1 comment
Labels
duplicate This issue or pull request already exists package: parser Issues related to @typescript-eslint/parser

Comments

@cawoodm
Copy link

cawoodm commented May 25, 2020

Tearing my hair out here trying to get VSCode to correct my Typescript. VSCode seems to recognize errors but ESLint is spitting errors.

Oops! Something went wrong! :(

ESLint: 7.1.0

TypeError: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.js': Class extends value undefined is not a constructor or null
    at Object.<anonymous> (C:\services\parts\node_modules\@typescript-eslint\experimental-utils\dist\ts-eslint\ESLint.js:14:31)
    at Module._compile (C:\Users\u29730\AppData\Roaming\npm\node_modules\eslint\node_modules\v8-compile-cache\v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
    at Module.load (internal/modules/cjs/loader.js:976:32)
    at Function.Module._load (internal/modules/cjs/loader.js:884:14)
    at Module.require (internal/modules/cjs/loader.js:1016:19)
    at require (C:\Users\u29730\AppData\Roaming\npm\node_modules\eslint\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
    at Object.<anonymous> (C:\services\parts\node_modules\@typescript-eslint\experimental-utils\dist\ts-eslint\index.js:15:14)
    at Module._compile (C:\Users\u29730\AppData\Roaming\npm\node_modules\eslint\node_modules\v8-compile-cache\v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)

Repro

module.exports = {
  root: true,
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 2020,
    sourceType: "module"
  },
  "extends": [
    "prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
    "plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
  ],
  rules: {
    "max-len": "off",
    "quote-props": "off",
    "object-curly-spacing": "off",
    "space-before-function-paren": [2, "never"],
  }
};
function foo() {
  'dont worry be happy'
} 

Expected Result
Would like VSCode to format my code but...
Actual Result
...nothing happens and I google my day away with eslint errors

Additional Info

Versions

package version
@typescript-eslint/parser 3.0.1
TypeScript 3.9.3
ESLint 7.1.0
node 13.2.0
npm 6.13.1
@cawoodm cawoodm added package: parser Issues related to @typescript-eslint/parser triage Waiting for team members to take a look labels May 25, 2020
@bradzacher
Copy link
Member

See #2100

@bradzacher bradzacher added duplicate This issue or pull request already exists and removed triage Waiting for team members to take a look labels May 25, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists package: parser Issues related to @typescript-eslint/parser
Projects
None yet
Development

No branches or pull requests

2 participants