xojs / eslint-config-xo-typescript

ESLint shareable config for TypeScript to be used with eslint-config-xo
MIT License
166 stars 25 forks source link

`switch-exhaustiveness-check` config mismatch? #83

Open fregante opened 4 months ago

fregante commented 4 months ago
Error: .eslintrc.js » eslint-config-pixiebrix » eslint-config-xo-typescript:
    Configuration for rule "@typescript-eslint/switch-exhaustiveness-check" is invalid:
    Value [{"allowDefaultCaseForExhaustiveSwitch":false,"requireDefaultForNonUnion":true}] should NOT have more than 0 items.

I have the latest dependencies in eslint-config-pixiebrix and I'm seeing this issue, but I don't understand why. The peer deps are not being resolved correctly according to npm:

❯ npm ls @typescript-eslint/eslint-plugin
npm ERR! code ELSPROBLEMS
├─┬ @shopify/eslint-plugin@44.0.0
│ ├── @typescript-eslint/eslint-plugin@6.10.0
│ └─┬ eslint-plugin-jest@27.6.0
│   └── @typescript-eslint/eslint-plugin@6.10.0 deduped
└─┬ eslint-config-pixiebrix@0.36.0
  ├── @typescript-eslint/eslint-plugin@7.0.2
  └─┬ eslint-config-xo-typescript@3.0.0
    └── @typescript-eslint/eslint-plugin@6.10.0 deduped invalid: ">=7.0.2" from node_modules/eslint-config-xo-typescript
fregante commented 4 months ago

I resolved with this in the project's package.json (not the config)

  "overrides": {
    "@typescript-eslint/eslint-plugin": "7.0.2"
  },
fregante commented 4 months ago

It started resolving correctly after mocking around 🤷‍♂️ I had already npm rm eslint-config-pixiebrix && npm I eslint-config-pixiebrix to no-avail

Mysteries of npm

fregante commented 4 months ago

Reopening since this still happens. It had disappeared because this sequence updates the lockfile, fixing the issue (presumably until a future update of the lockfile):

  1. add override
  2. install
  3. remove override