eslint-config-xo-typescript icon indicating copy to clipboard operation
eslint-config-xo-typescript copied to clipboard

`switch-exhaustiveness-check` config mismatch?

Open fregante opened this issue 1 year ago • 3 comments

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/[email protected]
│ ├── @typescript-eslint/[email protected]
│ └─┬ [email protected]
│   └── @typescript-eslint/[email protected] deduped
└─┬ [email protected]
  ├── @typescript-eslint/[email protected]
  └─┬ [email protected]
    └── @typescript-eslint/[email protected] deduped invalid: ">=7.0.2" from node_modules/eslint-config-xo-typescript

fregante avatar Feb 24 '24 18:02 fregante

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

  "overrides": {
    "@typescript-eslint/eslint-plugin": "7.0.2"
  },

fregante avatar Feb 24 '24 18:02 fregante

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 avatar Feb 24 '24 18:02 fregante

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

fregante avatar Feb 25 '24 10:02 fregante