0

I am using Hound CI as my code style cop, and BEM for my css naming, and Hound doesn't like BEM. How do you configure Hound to avoid commenting on BEM class names?

Peter David Carter
  • 2,548
  • 8
  • 25
  • 44

1 Answers1

0

Hound uses SCSS-lint for SCSS linting rules. To get Hound to account for BEM, we need to set the linter's selectorFormat convention to hyphenated_BEM. Here's one way to do so:

Hound looks for a .hound.yml file for your initial configuration. So, lets start by telling Hound to use a specific SCSS linter config file:

#.houndl.yml

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

Then we can set up our custom config in our SCSS linter file:

#.scss-linter-config.yml

linters:
  SelectorFormat:
    enabled: true
    convention: hyphenated_BEM

We should now get Hound comments that apply to BEM!