eslint-plugin-forbid-console
v1.0.0
Published
ESLint Plugin to forbid usage of console + optionally display custom message
Downloads
13
Maintainers
Readme
eslint-plugin-forbid-console 🚫
Forbid usage of console + optionally display custom message.
Can be helpful if you want to force some custom logger to be used, for instance.
Installation
Via npm:
npm i eslint-plugin-forbid-console --save-dev
Via yarn:
yarn add -D eslint-plugin-forbid-console
Configuration / Usage
Depending on how you configured your eslint instance, the following configuration might look a bit different.
For example using a json format would require the keys to be in quotes etc.
// .eslintrc.js
module.exports = {
// ...
plugins: [
"forbid-console",
// ... maybe other plugins here ...
],
rules: {
"forbid-console/check": [
"error",
{
ignoreLevels: ["error", "warn"],
customMessage: "Please use custom logger instead.",
},
],
// ... maybe other rules here ...
},
};