我有 rush 管理的 monorepository ( https://rushjs.io/ )
代码结构为:
如您所见,有两个 eslint 配置和两个目录node_modules(它只是由 rush 创建的符号链接)。
Eslint 支持完美工作。
但是我在前面的 eslint 配置方面遇到了一些麻烦。当我使用yarn eslint --ext .js --ext .jsx ./srcfrom directory运行它时
front,它可以工作。
但它不起作用,当 eslint 从 vscode 启动时。在输出中我看到:
Consider running eslint --debug /Users/oleg/Desktop/projects/hire/front/src/pages/config.js from a terminal to obtain a trace about the configuration files used.
[Error - 2:04:08 PM]
Failed to load plugin 'react' declared in 'front/.eslintrc': Cannot find module 'eslint-plugin-react'
Require stack:
- /Users/oleg/Desktop/projects/hire/__placeholder__.js
Referenced from: /Users/oleg/Desktop/projects/hire/front/.eslintrc
Happened while validating /Users/oleg/Desktop/projects/hire/front/src/pages/config.js …Run Code Online (Sandbox Code Playgroud)