Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

danger-plugin-no-console-ext

rizalibnu1.7kMIT1.2.2TypeScript support: included

Danger plugin to prevent merging code that still has console.logs inside it.

danger, danger-plugin

readme

danger-plugin-no-console

Build Status npm version semantic-release

Danger plugin to prevent merging code that still has console.logs inside it.

Usage

Install:

yarn add danger-plugin-no-console-ext --dev

At a glance:

// dangerfile.js
import { schedule } from 'danger'
import noConsole from 'danger-plugin-no-console-ext'

// Note: You need to use schedule()
schedule(noConsole())

Output example

Fails
⛔️

1 console statement(s) left in src/add.js.

Options

whitelist

You can specify a whitelist of console properties to let pass. This is useful to e.g. let errors be logged, like so:

// dangerfile.js
import noConsole from 'danger-plugin-no-console'

// Any file that contains console.log or console.info will fail,
// but files can contain console.error and console.warn
schedule(noConsole({ whitelist: ['error', 'warn'] }))

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.