Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joeybaker/eslint-plugin-no-console-log
An eslint plugin to warn on usage of console.log, unlike the built-in rule, this allows other console methods.
https://github.com/joeybaker/eslint-plugin-no-console-log
Last synced: 6 days ago
JSON representation
An eslint plugin to warn on usage of console.log, unlike the built-in rule, this allows other console methods.
- Host: GitHub
- URL: https://github.com/joeybaker/eslint-plugin-no-console-log
- Owner: joeybaker
- License: other
- Created: 2015-09-10T17:03:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-06T20:59:59.000Z (about 5 years ago)
- Last Synced: 2025-01-05T13:22:00.085Z (10 days ago)
- Language: Shell
- Homepage:
- Size: 17.6 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# DEPRECATED. This is now built-in to eslint 2.0
```json
no-console: [2, { allow: ["warn", "error"] }]
```# eslint-plugin-no-console-log [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-url]][daviddm-image] [![Build Status][travis-image]][travis-url]
An eslint plugin to warn on usage of `console.log`.
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [Install](#install)
- [Configuration](#configuration)
- [Rule Details](#rule-details)
- [When Not To Use It](#when-not-to-use-it)
- [Further Reading](#further-reading)
- [Tests](#tests)
- [Developing](#developing)
- [Requirements](#requirements)
- [License](#license)## Install
```sh
npm i -S eslint-plugin-no-console-log
```## Configuration
Add `plugins` section and specify eslint-plugin-no-console-log as a plugin.
```json
{
"plugins": [
"no-console-log"
]
}
```Then, enable the rule.
```json
{
"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:
```js
console.log('hi')
```
The following patterns are not warnings:
```js
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](http://eslint.org/docs/user-guide/migrating-to-1.0.0#deprecating-eslint-tester).* `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](http://byjoeybaker.com) and contributors. A copy of the license can be found in the file `LICENSE`.
[npm-url]: https://npmjs.org/package/eslint-plugin-no-console-log
[npm-image]: https://badge.fury.io/js/eslint-plugin-no-console-log.svg
[travis-url]: https://travis-ci.org/joeybaker/eslint-plugin-no-console-log
[travis-image]: https://travis-ci.org/joeybaker/eslint-plugin-no-console-log.svg?branch=master
[daviddm-url]: https://david-dm.org/joeybaker/eslint-plugin-no-console-log.svg?theme=shields.io
[daviddm-image]: https://david-dm.org/joeybaker/eslint-plugin-no-console-log