New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-no-console-log

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-console-log

Eslint plugin to warn on usage of `console.log`, unlike the built-in rule, this allows other `console` methods.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
238
decreased by-28.96%
Maintainers
1
Weekly downloads
 
Created
Source

DEPRECATED. This is now built-in to eslint 2.0

no-console: [2, { allow: ["warn", "error"] }]

eslint-plugin-no-console-log NPM version Dependency Status Build Status

An eslint plugin to warn on usage of console.log.

Table of Contents generated with DocToc

Install

npm i -S eslint-plugin-no-console-log

Configuration

Add plugins section and specify eslint-plugin-no-console-log as a plugin.

{
  "plugins": [
    "no-console-log"
  ]
}

Then, enable the rule.

{
  "rules": {
    "no-console-log/no-console-log": 1
  }
}

Rule Details

This rule warns when it sees console.log only. Other variants, like console.warn are allowed, as it's assumed you've left them there on purpose. If you'd like to disable all console methods use the built-in rule no-console.

The following patterns are considered warnings:


console.log('hi')

The following patterns are not warnings:


console.time('timer')
console.timeEnd('timer')
console.warn('oops')
console.error('kittens!')

When Not To Use It

If you want to disable all console use to enforce a custom logging option.

Further Reading

https://github.com/eslint/eslint/issues/2621#issuecomment-105961888

Tests

Tests are in eslint's RuleTester.

  • npm test will run the tests
  • npm run tdd will run the tests on every file change.

Developing

To publish, run npm run release -- [{patch,minor,major}]

NOTE: you might need to sudo ln -s /usr/local/bin/node /usr/bin/node to ensure node is in your path for the git hooks to work

Requirements

  • npm > 2.0.0 So that passing args to a npm script will work. npm i -g npm
  • git > 1.8.3 So that git push --follow-tags will work. brew install git

License

Artistic 2.0 © Joey Baker and contributors. A copy of the license can be found in the file LICENSE.

Keywords

FAQs

Package last updated on 08 Mar 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