karlspalding / sass-lint-brunch

Adds sass-lint support to brunch.
MIT License
2 stars 1 forks source link

Does not analyze _* files, which is not very useful... #3

Open christiannelson opened 7 years ago

christiannelson commented 7 years ago

We follow a convention that I think is pretty common:

Where app.scss @imports all of the other files.

Running sass-lint directly analyzes all of the files.

Using sass-lint-brunch, only app.scss is analyzed. It's what the README says, but unless I'm missing something, it severely limits the usefulness of this brunch plugin.

Ideally, this plugin would honor the files/include and files/ignore settings in the .sass-lint.yml configuration file.

Am I missing an option to get this working? Thanks!

fertapric commented 7 years ago

@christiannelson I've removed sass-lint-brunch from the list of dependencies and included on my brunch-config.js:

  hooks: {
    onCompile(generatedFiles, changedAssets) {
      var lint = require("sass-lint");
      var configOptions = {};
      var configPath = ".sass-lint.yml";

      var results = lint.lintFiles(null, configOptions, configPath)
      lint.outputResults(results, configOptions, configPath);
    }
  }

You must include sass-lint in your dependencies though.

I hope that helps!

mklinke commented 7 years ago

@fertapric Thanks for your workaround. Still, I'd be happy to see this working by default with this plugin...

sethherr commented 7 years ago

I second this feeling. I can't imagine why you would want the linter to ignore your underscore scss files - my manifest files typically don't have anything in them other than @includes, so they linting them isn't very useful.

I've added the workaround too, but it seems like something that shouldn't require a workaround.