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

postcss-log-warnings

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-log-warnings

Log PostCSS warnings in the console

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-36.36%
Maintainers
1
Weekly downloads
 
Created
Source

postcss-log-warnings Build Status

Log PostCSS warnings in the console.

Purpose

As of PostCSS 4.1, a single PostCSS process can accumulate warnings from all of the plugins it uses. Presumably, plugin authors want you to see those warnings. So this plugin exists to read the accumulated warnings (or warnings from only the plugins you've specified), format them for human legibility, and print them to the console.

Example Output

Example

Installation

npm install postcss-log-warnings

Usage

Add it to your plugin list after any plugins whose warnings you want to log, and pass it an object of options.

For example, using gulp-postcss:

gulp.task('css', function() {
  return gulp.src('./src/*.css')
    .pipe(postcss([
      bemLinter(),
      customProperties(),
      calc(),
      rejectAllColors(),
      logWarnings(myOptions) // <------ ding
    ]))
    .pipe(gulp.dest('./dist'));
});

By default, this plugin will clear the warnings after it logs them. Otherwise, your other plugins or your PostCSS runner might re-print the same warnings, causing some confusion. This can be changed by setting the option { keepWarnings: true }.

Options

  • keepWarnings (boolean, default = false)

    If true, the plugin will not clear the warnings after it logs them (by default, it will clear them). Other plugins will then have access to these warnings and might re-print them.

  • plugins (array of strings, default = [])

    If empty, the plugin will log every warning, regardless of which plugin registered it. To limit output, name the plugins whose warnings you would like to see. For example, { plugins: ['postcss-bem-linter'] } will only log warnings from the postcss-bem-linter plugin.

  • throwError (boolean, default = false)

    If true, after the plugin logs your warnings it will exit the process with code 1 if it found any warnings.

FAQs

Package last updated on 24 May 2015

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