[英]With eslint-webpack-plugin@2.4.1, how do you use eslint's cache?
[英]How to use eslint plugin modules located in parent directory?
我有一些服务以这样的方式组织成monorepo:
repo_root/ ├── services/ │ ├── service_one/ │ ├── service_two/ │ └── service_three/ ├── package.json ├── node_modules ├── .eslintrc
此外,每个服务都有自己的package.json
和node_modules
。 我想使用存储在repo_root
目录中的eslint配置来lint各个服务。 我的问题是当我尝试运行类似的东西时
eslint services/service_one
例如,它未能找到由所需的eslint插件模块.eslintrc
并安装在node_modules
的目录repo_root
。
我想避免在每个服务中冗余地要求这些插件模块。 是否有配置eslint智能查找模块,即使它们在服务的父目录中?
对于任何想知道的人,我的问题是我使用全局安装的eslint运行命令,而eslint又查找全局模块。 更改它以运行本地版本的eslint后,一切正常!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.