gpt4 book ai didi

css - Conjuring Hound.ci 与 BEM 一起工作

转载 作者:行者123 更新时间:2023-11-28 05:46:34 24 4
gpt4 key购买 nike

我正在使用 Hound CI 作为我的代码风格警察, BEM 对于我的 css 命名,Hound 不喜欢 BEM。如何配置 Hound 以避免对 BEM 类名进行注释?

最佳答案

猎犬使用SCSS-lint用于 SCSS linting 规则。为了让 Hound 考虑 BEM,我们需要设置 linter 的 selectorFormat hyphenated_BEM 的约定。这是一种方法:

Hound 为您的初始配置寻找一个 .hound.yml 文件。因此,让我们首先告诉 Hound 使用特定的 SCSS linter 配置文件:

#.houndl.yml

scss:
config_file: .scss-linter-config.yml

然后我们可以在我们的 SCSS linter 文件中设置我们的自定义配置:

#.scss-linter-config.yml

linters:
SelectorFormat:
enabled: true
convention: hyphenated_BEM

我们现在应该得到适用于 BEM 的 Hound 评论!

关于css - Conjuring Hound.ci 与 BEM 一起工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37571701/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com