我已经完成了一个内部 eslint 插件的制作,但不幸的是我们公司要求我们在所有内部 npm 包前加上 companyName- 前缀。这会导致 eslint 查找带有 eslint-plugin- 前缀的包时出现问题,因为我的包的前缀是 companyName-*。
在我的 .eslintrc 中我有
"plugins": [
"react",
"babel",
"lodash",
"companyName-eslint-plugin-projectName"
],
eslint 将 eslint-plugin
附加到 companyName-eslint-plugin-teamName
并尝试查找 eslint-plugin-companyName-eslint-plugin-teamName
有没有办法在.eslintrc中绕过这个?
最佳答案
我自己想出来了。您可以使用您的公司名称设置一个 npm 范围,然后在该范围下发布插件:@companyName/eslint-plugin-something。
关于javascript - 如何让内部 eslint 插件在没有 eslint-plugin-* 前缀的情况下工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44440957/