rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

Can't disable sass warning "filename should end with module.scss"

Open bastianjohn opened this issue 9 years ago • 1 comments

Hi,

i am using the web-build-tools in a SPFx project. Then i added a test.scss file, so that no hashes are added to the classes i am using. In the gulp task there is now a warning displayed:

Warning - [sass] src\webparts\utilities\circleProgress.scss: filename should end with module.scss

I've tried to disable this warning by setting the config for the build task. But the default sass config is warnOnNonCSSModules: false. My Build Task looks like the following:

const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
console.log(build.sass.taskConfig);
build.sass.setConfig({ warnOnNonCSSModules: false, useCssModules:true});
build.initialize(gulp);

In the console there is the following output:

{ preamble: '/* tslint:disable */',
  postamble: '/* tslint:enable */',
  sassMatch: [ 'src/**/*.scss' ],
  useCSSModules: false,
  warnOnCssInvalidPropertyName: true,
  dropCssFiles: false,
  warnOnNonCSSModules: false }

How can i achieve to hide the warning? Am i using the wrong property?

I am using the SP-Build-Web 1.1.0.

Thanks

bastianjohn avatar Aug 30 '17 12:08 bastianjohn

hi @nickpape-msft, that worked great, the warning is gone! Thanks for theworkaround and your help!

bastianjohn avatar Sep 06 '17 07:09 bastianjohn