1.0.1 • Published 6 months ago

@adguard/eslint-plugin-logger-context v1.0.1

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

@adguard/eslint-plugin-logger-context

A minimal ESLint plugin for AdGuard projects that requires logger calls to start with a context tag.

Install

pnpm add -D @adguard/eslint-plugin-logger-context

Quick Start

Add to your .eslintrc.js:

module.exports = {
  plugins: [
    '@adguard/logger-context',
  ],
  rules: {
    '@adguard/logger-context/require-logger-context': ['error', {
      // optional
      contextModuleName: 'moduleName',
      // optional
      loggerVariableName: 'logger',
    }],
  },
};

Example of correct usage:

logger.info('[ext.page-handler]: some message');
1.0.1

6 months ago