Is there a way to make the SCSS compiler less nitpicky?

Is there a way to make the SCSS compiler less nitpicky in Sage 9?

e.g.
1:19 ✖ Expected newline after ","
9:21 ✖ Unexpected whitespace at end of line

I don’t care if my file isn’t “formatted to perfection”, and these constant errors are just slowing me down.

You can customize the rules in the stylelint section of your theme’s package.json to adjust what it picks up and complains about.

You could also remove the linting completely by deleting this section of resources/assets/build/webpack.config.js:

new StyleLintPlugin({
      failOnError: !config.enabled.watcher,
      syntax: 'scss',
 }),

You could also implement Prettier into your workflow, either in webpack or through your text editor, which will automatically fix automatically fixable errors in your CSS/SCSS, as defined by your stylelint config.

5 Likes