Skip to content

NodeJS 13: Failed to load plugin '@typescript-eslint' #1944

Closed
@Ximik

Description

@Ximik

The eslint stops working after updating from node v12.16.1 to v13.13.0.

.eslintrc.cjs

module.exports = {
  root: true,
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: ['./tsconfig.json'],
  },
  plugins: ['@typescript-eslint'],
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/eslint-recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:@typescript-eslint/recommended-requiring-type-checking',
  ],
  rules: {
  },
};

tsconfig.json

{
  "compilerOptions": {
    "noImplicitAny": true,
    "noImplicitThis": true,
    "strictNullChecks": true,
    "alwaysStrict": true,
    "target": "es6",
    "module": "es6",
    "moduleResolution": "node",
    "declaration": true,
    "outDir": "./lib"
  }
}

package.json

{
  "type": "module",
  "scripts": {
    "lint": "eslint src --ext .ts,.js --fix && tsc --noEmit"
  },
  "devDependencies": {
    "@typescript-eslint/eslint-plugin": "^2.30.0",
    "@typescript-eslint/parser": "^2.30.0",
    "eslint": "^6.8.0",
    "typescript": "^3.8.3"
  }
}

The output

$ ./node_modules/.bin/eslint src --ext .ts,.js --debug
  eslint:cli CLI args: [ 'src', '--ext', '.ts,.js', '--debug' ] +0ms
  eslint:cli Running on files +3ms
  eslint:config-array-factory Loading JSON config file: /home/alex/tracker/package.json +0ms
  eslint:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/node_modules/*', '/bower_components/*' ], basePath: '/home/alex/tracker', loose: false } ] +0ms
  eslint:ignore-pattern   processed: { basePath: '/home/alex/tracker', patterns: [ '/node_modules/*', '/bower_components/*' ] } +1ms
  eslint:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/node_modules/*', '/bower_components/*' ], basePath: '/home/alex/tracker', loose: false } ] +1ms
  eslint:ignore-pattern   processed: { basePath: '/home/alex/tracker', patterns: [ '/node_modules/*', '/bower_components/*' ] } +0ms
  eslint:file-enumerator Start to iterate files: [ 'src' ] +0ms
  eslint:file-enumerator Directory: /home/alex/tracker/src +0ms
  eslint:file-enumerator Enter the directory: /home/alex/tracker/src +0ms
  eslint:cascading-config-array-factory Load config files for /home/alex/tracker/src. +0ms
  eslint:cascading-config-array-factory No cache found: /home/alex/tracker/src. +0ms
  eslint:config-array-factory Config file not found on /home/alex/tracker/src +5ms
  eslint:cascading-config-array-factory No cache found: /home/alex/tracker. +0ms
  eslint:config-array-factory Loading JS config file: /home/alex/tracker/.eslintrc.cjs +1ms
  eslint:config-array-factory Config file found: /home/alex/tracker/.eslintrc.cjs +5ms
  eslint:config-array-factory Loading {extends:"eslint:recommended"} relative to /home/alex/tracker/.eslintrc.cjs +1ms
  eslint:config-array-factory Loading JS config file: /home/alex/tracker/node_modules/eslint/conf/eslint-recommended.js +0ms
  eslint:config-array-factory Loading {extends:"plugin:@typescript-eslint/eslint-recommended"} relative to /home/alex/tracker/.eslintrc.cjs +0ms
  eslint:config-array-factory Loading plugin "@typescript-eslint" from /home/alex/tracker/.eslintrc.cjs +1ms
  eslint:config-array-factory Loaded: @typescript-eslint/eslint-plugin@2.30.0 (/home/alex/tracker/node_modules/@typescript-eslint/eslint-plugin/dist/index.js) +1ms
  eslint:config-array-factory Failed to load plugin '@typescript-eslint' declared in '.eslintrc.cjs'. +193ms
TypeError: Failed to load plugin '@typescript-eslint' declared in '.eslintrc.cjs': Cannot convert undefined or null to object
Referenced from: /home/alex/tracker/.eslintrc.cjs
    at Function.getOwnPropertyNames (<anonymous>)
    at /home/alex/tracker/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js:79:19
    at Array.map (<anonymous>)
    at Object.<anonymous> (/home/alex/tracker/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js:77:48)
    at Module._compile (/home/alex/tracker/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:972:32)
    at Function.Module._load (internal/modules/cjs/loader.js:872:14)
    at Module.require (internal/modules/cjs/loader.js:1012:19)
    at require (/home/alex/tracker/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting responseIssues waiting for a reply from the OP or another partypackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions