withspectrum/danger-plugin-no-console

Name: danger-plugin-no-console

Owner: Spectrum

Description: DangerJS plugin to prevent merging any code that contains console log statements

Created: 2018-03-14 09:21:03.0

Updated: 2018-05-01 05:15:09.0

Pushed: 2018-03-19 10:59:35.0

Homepage: null

Size: 152

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

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:

 add danger-plugin-no-console --dev

At a glance:

angerfile.js
rt { schedule } from 'danger'
rt noConsole from 'danger-plugin-no-console'

ote: You need to use schedule()
dule(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:

angerfile.js
rt noConsole from 'danger-plugin-no-console'

ny file that contains console.log or console.info will fail,
ut files can contain console.error and console.warn
dule(noConsole({ whitelist: ['error', 'warn'] }))
Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.