question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cant load with eslint and typescript

See original GitHub issue

Versions:

"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"eslint": "^8.9.0",
"eslint-config-standard": "^17.0.0-1",
"eslint-config-typescript": "^3.0.0",
"eslint-plugin-jest": "^26.1.1"

Config:

{
  "env": {
    "jest/globals": true,
    "serviceworker": true
  },
  "extends": [
    "typescript",
    "standard"
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json",
    "ecmaVersion": "latest",
    "sourceType": "module"
  },
  "plugins": [
    "jest",
    "@typescript-eslint"
  ],
  "rules": {
    "no-unused-vars": "off",
    "@typescript-eslint/no-unused-vars": "error",
    "@typescript-eslint/ban-ts-comment": "off",
    "@typescript-eslint/no-explicit-any": "off",
    "jest/no-disabled-tests": "warn",
    "jest/no-focused-tests": "warn",
    "jest/no-identical-title": "error",
    "jest/prefer-to-have-length": "warn",
    "jest/valid-expect": "error"
  },
  "ignorePatterns": [
    "**/dist/**"
  ]
}

Hello!

Im getting the following error using the above versions and config:

 Error: Failed to load plugin 'jest' declared in '.eslintrc.json': Cannot find module 'eslint-plugin-jest'

Here is the full stack trace:

(node: 56976) UnhandledPromiseRejectionWarning: Error: Failed to load plugin 'jest' declared in '.eslintrc.json': Cannot find module 'eslint-plugin-jest'
Require stack:
- /Users/user/project/__placeholder__.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js: 934: 15)
    at Function.resolve (internal/modules/cjs/helpers.js: 94: 19)
    at Object.resolve (/Users/user/project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs: 1112: 46)
    at ConfigArrayFactory._loadPlugin (/Users/user/project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs: 3347: 33)
    at /Users/user/project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs: 3238: 33
    at Array.reduce (<anonymous>)
    at ConfigArrayFactory._loadPlugins (/Users/user/project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs: 3234: 22)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/user/project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs: 3055: 44)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/Users/user/project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs: 2995: 20)

This config seems to work ok in other projects. Specifically this one: https://github.com/SupremeTechnopriest/react-idle-timer/blob/master/.eslintrc.json. Any idea what might be wrong?

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
SupremeTechnopriestcommented, Feb 25, 2022

Damn looks like I just had to restart vscode for that project. Sorry for the false alarm and thanks for the quick feedback! I will close this issue!

0reactions
kinolicommented, Apr 1, 2022

Damn looks like I just had to restart vscode for that project. Sorry for the false alarm and thanks for the quick feedback! I will close this issue!

Thanks, same issue with me, just restarted eslint and it works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load plugin @ typescript-eslint: cannot find module ...
I reconfigure my project from tslint to eslint. I can start eslint manually, but the webpack does not start with this error message:...
Read more >
8.0.0 Failed to load plugin '@typescript-eslint' - Stack Overflow
TypeError: Failed to load plugin '@typescript-eslint' declared in 'src.eslintrc': Class extends value undefined is not a constructor or null ...
Read more >
WEB-53184 - YouTrack
Error: Failed to load plugin '@typescript-eslint' declared in '../../../.eslintrc.json': Cannot find module '@typescript-eslint/eslint-plugin'.
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
eslint-import-resolver-typescript - npm
If either fails, we won't be able to merge your PR until it's fixed. Sponsors. 1stG, RxTS, UnTS. 1stG Open Collective backers and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found