standard / ts-standard

Typescript style guide, linter, and formatter using StandardJS
https://www.npmjs.com/package/ts-standard
MIT License
464 stars 36 forks source link

Error: failed to load plugin #204

Closed slastig13 closed 1 year ago

slastig13 commented 2 years ago

What version of this package are you using? 11.0.0 What operating system, Node.js, and npm version? Mac OS big sur 11.6.2, node v16.13.1, yarn 1.22.11 What happened?

Error: Failed to load plugin '@typescript-eslint' declared in '--config » eslint-config-standard-with-typescript': Cannot find module 'typescript'

What did you expect to happen? Ability to run "ts-standard" without above error.

Are you willing to submit a pull request to fix this bug? Yes but I don't know how to fix it.

anonrig commented 2 years ago

I'm facing the same issue.

sambauers commented 2 years ago

A dependency of ts-standard is not compatible with eslint version 8+

Adding the latest version of that dependency directly got me past this issue:

npm install @typescript-eslint/experimental-utils@latest --save-dev
pro-sumer commented 2 years ago

I'm completely new to TypeScript (first experiments yesterday), but would still like to use ts-standard (like I used standard for JavaScript). I'm not using eslint v8, but I'm still running into this issue. I can't find simple instructions on how to set up ts-standard...

This is the relevant part of my package.json:

  "devDependencies": {
    "@tsconfig/node18": "*",
    "@types/ical": "*",
    "@types/node": "*",
    "@typescript-eslint/parser": "^4.26.1",
    "@typescript-eslint/eslint-plugin": "^4.26.1",
    "eslint": "^7.28.0",
    "ts-standard": "^11.0.0",
    "typescript": "^4.3.2"
  }

What's wrong? How to fix it?