npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mimik/eslint-plugin-logger

v1.0.3

Published

Validation of logger call parameters for mimik services

Readme

@mimik/eslint-plugin-logger

ESLint plugin that validates logger call arguments for mimik services.

Installation

npm install --save-dev @mimik/eslint-plugin-logger

Usage

Add the plugin to your eslint.config.js:

import loggerPlugin from '@mimik/eslint-plugin-logger';

export default [
  {
    plugins: { logger: loggerPlugin },
    rules: {
      'logger/validate-logger-args': 'error',
    },
  },
];

Rule: validate-logger-args

Validates that logger calls (on default-imported modules) use the correct argument signatures.

Valid Signatures

All three access patterns are supported:

import logger from '@mimik/sumologic-winston-logger';

// Dot notation
logger.info('User logged in', correlationId);

// Bracket notation with string literal
logger['info']('User logged in', correlationId);

// Bracket notation with variable (any variable name)
logger[level]('User logged in', correlationId);
logger[severity]('User logged in', correlationId);

The four argument signatures:

// (message, correlationId)
logger.info('User logged in', correlationId);

// (message, meta, correlationId)
logger.info('User logged in', { userId: 123 }, correlationId);

// (message, correlationId, options)
logger.info('User logged in', correlationId, { type: 'audit' });

// (message, meta, correlationId, options)
logger.info('User logged in', { userId: 123 }, correlationId, { type: 'audit' });

Arguments

| Argument | Type | Required | Description | |---|---|---|---| | message | string | Yes | Log message | | meta | object | No | Metadata object with additional context | | correlationId | string | Yes | Correlation ID for request tracing | | options | object | No | Options object, must contain a type string property |

Supported Log Levels

error, warn, info, verbose, debug, silly

What Gets Checked

  • The rule only applies to default imports (e.g. import logger from '...')
  • Named imports (import { logger } from '...') are ignored
  • Supports dot notation (logger.info), bracket notation with a string literal (logger['info']), and bracket notation with a variable (logger[level])
  • For bracket notation with a string literal, the value must be a recognized log level
  • For bracket notation with a variable, the call is always validated (the variable is assumed to hold a valid level)
  • Minimum 2 arguments, maximum 4
  • message must be a string (when passed as a literal)
  • correlationId must be a string (when passed as a literal)
  • options object must contain a type property with a string value
  • When 2 arguments are passed and the 2nd is an object or array literal, it is treated as (message, meta) with a missing correlationId
  • When 3 arguments are passed, the 2nd argument type determines the signature:
    • Object literal → (message, meta, correlationId)
    • Otherwise → (message, correlationId, options)

API Reference

The plugin exports a single object with the following shape:

{
  rules: {
    'validate-logger-args': { meta, create(context) }
  }
}

Error Messages

| Message ID | Description | |---|---| | tooFewArguments | Fewer than 2 arguments passed | | tooManyArguments | More than 4 arguments passed | | messageNotString | First argument is a non-string literal | | correlationIdNotString | correlationId argument is a non-string literal | | missingCorrelationId | 2nd argument is an object or array — correlationId is missing | | optionsNotObject | Options argument is a literal instead of an object | | optionsMissingType | Options object does not contain a type property | | optionsTypeNotString | Options type property is a non-string literal |

License

MIT