alleyinteractive / sasslint-webpack-plugin

A webpack plugin to lint your SCSS/SASS code
MIT License
33 stars 12 forks source link

Add ability to eliminate a lint rule per line or file #20

Closed todd-richmond closed 8 years ago

todd-richmond commented 8 years ago

See [http://stackoverflow.com/questions/35136098/have-sass-lint-ignore-a-certain-line] for a thread on this. It seems that scss lint might support this in a similar way to eslint for JS files

There are often a few cases in any code base where you need to disable a lint rule for some particular reason. In my case, I need to import Google Material Design icons, but the documented css logic causes no-duplicate-properties and no-vendor-prefixes to fire. I therefore want to keep those rules for every other file in my tree except my font.scss file

// http://google.github.io/material-design-icons/
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url('~material-design-icons/iconfont/MaterialIcons-Regular.eot'); // IE
  src: local('Material Icons'),
  local('MaterialIcons-Regular'),
  url('~material-design-icons/iconfont/MaterialIcons-Regular.woff2') format('woff2'),
  url('~material-design-icons/iconfont/MaterialIcons-Regular.woff') format('woff'),
  url('~material-design-icons/iconfont/MaterialIcons-Regular.ttf') format('truetype');
}

.material-icons {
  // Firefox
  -moz-osx-font-smoothing: grayscale;
  // WebKit
  -webkit-font-smoothing: antialiased;
  direction: ltr;
  display: inline-block;
  font-family: 'Material Icons';
  // IE
  font-feature-settings: 'liga';
  // preferred icon size
  font-size: 24px;
  font-style: normal;
  font-weight: normal;
  letter-spacing: normal;
  line-height: 1;
  // Safari, Chrome
  text-rendering: optimizeLegibility;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
}
todd-richmond commented 8 years ago

see https://github.com/sasstools/sass-lint/issues/70 - looks close to complete...