1.0.0 • Published 9 months ago

eslint-plugin-forbid-console v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

eslint-plugin-forbid-console 🚫

Version

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 ...
  },
};

If you enjoy using this...