简体   繁体   English

如何在没有eslint-plugin- *前缀的情况下获取内部eslint插件

[英]How to get internal eslint plugins without the eslint-plugin-* prefix to work

I have finished making an internal eslint plugin, but unfortunately our company requires us to prefix all of our internal npm packages with companyName-. 我已经完成了内部eslint插件的制作,但不幸的是,我们公司要求我们在所有内部npm软件包之前都加上companyName-前缀。 This is causing issues with eslint looking for packages with eslint-plugin- prefix since my package is prefixed with companyName-*. 这会导致eslint查找带有eslint-plugin-前缀的软件包的问题,​​因为我的软件包的前缀是companyName- *。

in my .eslintrc I have 在我的.eslintrc中

"plugins": [
  "react",
  "babel",
  "lodash",
  "companyName-eslint-plugin-projectName"
], 

eslint appends eslint-plugin to companyName-eslint-plugin-teamName and tries to look for eslint-plugin-companyName-eslint-plugin-teamName eslint将eslint-plugin附加到companyName-eslint-plugin-teamName并尝试查找eslint-plugin-companyName-eslint-plugin-teamName

is there anyway to bypass this in .eslintrc? 反正在.eslintrc中绕过这个?

figured it out myself. 我自己想通了。 You could set up an npm scope with your company name, and then publish the plugin under that scope: @companyName/eslint-plugin-something. 您可以使用公司名称设置npm范围,然后在该范围下发布插件:@ companyName / eslint-plugin-something。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM