1
我以这样的方式组织成monorepo一些服务:如何使用位于父目录中的eslint插件模块?
repo_root/ ├── services/ │ ├── service_one/ │ ├── service_two/ │ └── service_three/ ├── package.json ├── node_modules ├── .eslintrc
此外,每个服务都有自己的package.json
和node_modules
。我想使用存储在repo_root
目录中的eslint配置来为各个服务提供服务。我的问题是,当我试图像
eslint services/service_one
例如运行的东西,它无法找到由.eslintrc
要求和安装在node_modules
目录repo_root
的eslint插件模块。
我想避免在每项服务中冗余地需要这些插件模块。有没有办法配置eslint智能地查找模块,即使它们位于服务本身的父目录中?
根据你所描述的,它应该工作,因为看起来正确。你能分享确切的错误,你确定插件已安装..也分享你的.eslintrc内容 – Gyandeep
最好的情况下,如果你可以分享项目或在github上设置一个可重复的案例n在这里分享链接... – Gyandeep
你'对,请看下面的答案。下次我会确保发布一些示例代码。感谢您的反馈! –