简体   繁体   English

如何安装和使用为CLI编写的自定义CSSLint规则?

[英]How do I install and use the custom CSSLint rules I have written for the CLI?

I am using CSSLint via the CLI. 我正在通过CLI使用CSSLint。 I have spent quite a bit of time following the steps found here and here to write custom css linting rules. 我花了很多时间按照此处此处找到的步骤来编写自定义css linting规则。 They are tested and they work correctly, however now that I have created the rules I am not sure how to actually add them to the linter (or installed via npm) so that can be used via the CLI to lint my projects. 它们已经过测试并且可以正常工作,但是,现在我创建了规则,现在我不确定如何将它们实际添加到linter(或通过npm安装)中,以便可以通过CLI来使用它来填充我的项目。 I have scoured the documentation in the github wiki and cannot seem to find an answer. 我已经在github wiki上搜索了文档,但似乎找不到答案。

Keep in mind these rules are project specific and they are not meant to be submitted to the csslint github repo. 请记住,这些规则是特定于项目的,它们不打算提交给csslint github存储库。

Figured it out. 弄清楚了。 I used 'grunt release' and then published it as an npm module, and then installed it. 我使用了“ grunt release”,然后将其发布为npm模块,然后安装了它。 The cause for the issue was that I needed to uninstall the original version of cssLint as it was overriding the new one. 问题的原因是我需要卸载原始版本的cssLint,因为它覆盖了新版本。

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

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