ESLint жалуется на то, что плагины ESLint не установлены в monorepo - PullRequest
1 голос
/ 03 мая 2019

При установке monorepo я получаю ошибки из-за того, что некоторые плагины ESLint не устанавливаются, в то время как у меня нет этих плагинов в списке в моем массиве plugins.

В моем проекте несколько пакетов под packages/**

yarn lint
yarn run v1.15.2
$ eslint --config .eslintrc ./

Oops! Something went wrong! :(

ESLint: 5.16.0.
ESLint couldn't find the plugin "eslint-plugin-airbnb". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-airbnb is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm i eslint-plugin-airbnb@latest --save-dev

Path to ESLint package: /mnt/airlab/repos/one/node_modules/eslint

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

1 Ответ

1 голос
/ 03 мая 2019

Эта проблема возникает из-за того, что некоторые пакеты поставляют с собой файл .eslintrc, и ESLint выбирает эти конфиги при запуске. По умолчанию ESLint игнорирует все конфиги в node_modules, но если у вас есть .eslintignore, вы должны добавить строку для игнорирования глубоких папок node_modules, чтобы эти паразитные конфиги не были выбраны.

.eslintignore

packages/**/node_modules
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...