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

eslint-plugin-naming-vocabulary

v1.0.0

Published

ESLint plugin to enforce consistent identifier vocabulary — boolean prefixes, synonym canonicalization, and domain-scoped naming

Readme

eslint-plugin-naming-vocabulary

ESLint plugin that enforces consistent identifier vocabulary across your codebase — boolean prefixes, synonym canonicalization, and mixed-synonym detection.

Rules

| Rule | Description | Default | |------|-------------|---------| | boolean-prefix | Enforce is/has/can/… prefixes on boolean identifiers | warn | | synonym-canonical | Flag forbidden synonym tokens and suggest the canonical term | off* | | mixed-synonym-usage | Warn when a file uses multiple synonyms from the same group | off* |

*Requires user-defined vocabulary groups.

Installation

npm install --save-dev eslint-plugin-naming-vocabulary
# or
pnpm add -D eslint-plugin-naming-vocabulary
# or
yarn add --dev eslint-plugin-naming-vocabulary

Quick start

// eslint.config.mjs
import namingVocabulary from 'eslint-plugin-naming-vocabulary';

const GROUPS = [
  { name: 'get', canonical: 'get', forbidden: ['fetch', 'load', 'retrieve'] },
];

export default [
  {
    plugins: { 'naming-vocabulary': namingVocabulary },
    settings: { 'naming-vocabulary': { groups: GROUPS } },
    rules: {
      'naming-vocabulary/boolean-prefix': 'warn',
      'naming-vocabulary/synonym-canonical': ['warn', { groups: GROUPS }],
      'naming-vocabulary/mixed-synonym-usage': ['warn', { groups: GROUPS }],
    },
  },
];

Or use the recommended config (enables boolean-prefix only):

import namingVocabulary from 'eslint-plugin-naming-vocabulary';

export default [namingVocabulary.configs.recommended];

Rule details

boolean-prefix

Flags identifiers that hold boolean values without an allowed prefix.

// ✗ bad
const active = true;
const enabled = false;

// ✓ good
const isActive = true;
const hasPermission = false;

Default allowed prefixes: is has can should will did needs may. Customize with allowedPrefixes.

Full docs

synonym-canonical

Flags forbidden synonym tokens in identifier names and suggests the canonical replacement.

// ✗ bad — 'fetch' is forbidden, canonical is 'get'
const fetchUser = () => {};

// ✓ good
const getUser = () => {};

Suggestions are safe (never auto-applied): use your editor's Quick Fix menu.

Full docs

mixed-synonym-usage

Warns when the same file uses multiple synonyms from the same vocabulary group.

// ✗ bad — same file uses both 'fetch' and 'load' from the 'get' group
const fetchUser = () => {};
const loadSettings = () => {};

Full docs

Shared vocabulary groups

Define groups once and share them across rules via ESLint settings:

settings: {
  'naming-vocabulary': {
    groups: [
      { name: 'get',    canonical: 'get',    forbidden: ['fetch', 'load', 'retrieve'] },
      { name: 'create', canonical: 'create', forbidden: ['make', 'build', 'generate'] },
      { name: 'delete', canonical: 'delete', forbidden: ['remove', 'destroy', 'erase'] },
    ],
  },
},

Requirements

  • Node.js ≥ 18
  • ESLint ≥ 8.0.0

License

MIT