prettier / eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.
MIT License
5.34k stars 251 forks source link

Global installation #239

Closed Lippiece closed 1 year ago

Lippiece commented 1 year ago

Is there any way to make it work with eslint installed globally? When I install this config with -g, eslint throws an error that it can't find "prettier" to extend from.

.eslintrc.yaml:

extends:
...
  - "prettier"
$ npm ls -g
/usr/lib
├── eslint-config-prettier@8.6.0
...
├── eslint@8.27.0
...
└── npm@8.19.2
Lippiece commented 1 year ago

Managed to workaround by setting:


extends:
...
  - "<path-to-global-modules-dir>/node_modules/eslint-config-prettier"
lydell commented 1 year ago

Hi! There is nothing special with eslint-config-prettier. (In fact, it’s one of the simplest configs in existence.) If you try this with some other config you should get the same result. You need to search for this yourself, or ask in some ESLint forum.