Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-polish

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-polish

Make your stylesheets perfect. Add an extra coat of polish.

  • 5.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-polish

Build Status codecov.io bitHound Overall Score bitHound Dependencies

gulp plugin for integrating Polish.

Install

npm install --save gulp-polish

Gulp task

var gulp   = require('gulp');
var polish = require('gulp-polish');

gulp.task('polish', function() {
  return gulp.src('./test_stylesheets/**/*.scss')
    .pipe(polish())
    .pipe(polish.reporter());
});

Results

gulp-polish adds the following properties to the file object:

file.polish.success = false;  // or true, if there aren't any warnings or errors!

file.polish.errors = [...];   // Every failure with severity 2
file.polish.warnings = [...]; // Every failure with severity 1

Configuring rules

To configure which rules are applied on a per-directory basis, use .polish.json files. The config will inherit from its parents directories. Just create a simple JSON object that specifies rules to include/exclude by filename.

{
  "config": [
    {
      "module"   : "polish-no-styling-elements",
      "severity" : 2 // an error
    },
    {
      "module"   : "polish-no-bang-important",
      "severity" : 1 // a warning
    },
    {
      "module"    : "polish-no-banned-selectors",
      "severity"  : 0 // ignored,
      "selectors" : [".these", "#will", ".be", "#banned"]
    }
  ],
  "fileConfig": {
    // individual files can be configured like this
    "_colors.scss": [
      {
        "module"    : "polish-use-color-variables",
        "severity"  : 0
      }
    ]
  }
}

If you want to disable a particular ruleset in a file, you can do an inline config that will apply only to the next rule in the sheet:

/* polish no-styling-ids=false */
#now-this-wont-be-an-error {
  color: green;
}

#but-this-one-will-be {
  color: red;
}

License

This project is licensed under the terms of the MIT license.

Keywords

FAQs

Package last updated on 26 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc