Socket
Socket
Sign inDemoInstall

postcss-solemn

Package Overview
Dependencies
13
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    postcss-solemn

A PostCSS plugin that detects inappropriate language in your CSS.


Version published
Maintainers
1
Install size
2.80 MB
Created

Readme

Source

postcss-solemn

A PostCSS plugin that detects inappropriate language in your CSS code.

Usage


var processors = [
    solemn({
        reportViolations: false,
        callback: function(violations, violationMessages) {
            console.log(violations);
            console.log(violationMessages);
        },
        dictionaries: ['dictionary1.json', 'dictionary2.json']
    })
];

gulp.src('styles/*.css')
    .pipe(postcss(processors));

Options

reportViolations

If true, it prints violation messages to the screen.

callback (optional)

A callback to receive two arrays - an array of violations and an array of corresponding violationMessages. The callback must be in the following form:


function(violations, violationMessages) {
  // do something
}

dictionaries

An array of dictionary files to use for detecting inappropriate language.

Each custom dictionary is a JSON file with the following format:

{
  "word1": ["category1", "category3"],
  "word2": ["category2"],
  "word3": ["category1"]
  "word4": ["category2", "category3", "category4"]
}

Every word must have at least one violation category. If multiple dictionaries are specified, words and their categories are merged.

Test

To test the module, run the follow from the command line:


npm test

Keywords

FAQs

Last updated on 27 Jun 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc