Registry / testing / eslint-plugin-case-police

eslint-plugin-case-police

JSON →
library2.2.1jsnpmunverified

ESLint plugin that enforces correct casing of brand names, technologies, and terms (e.g., 'GitHub', 'npm', 'TypeScript') by linting against a curated dictionary. Version 2.2.1 is current; requires ESLint ^9.9.0 or ^10.0.0. Uses flat config (ESLint 9+). Maintained by Anthony Fu with regular updates to dictionary entries. Differentiates from style linting rules by focusing exclusively on known proper nouns.

npm install eslint-plugin-case-police
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-CASE
E
eslint-plugin-case-police
testingjavascriptv2.2.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import casePolice from 'eslint-plugin-case-police'
const casePolice = require('eslint-plugin-case-police')
ESM-only since v2; CommonJS require works but is not recommended.
plugin
import casePolice from 'eslint-plugin-case-police'
import { casePolice } from 'eslint-plugin-case-police'
Default export is the plugin object; named export does not exist.
rule in flat config
plugins: { 'case-police': casePolice }, rules: { 'case-police/no-case-police': 'error' }
rules: { 'case-police/no-case-police': 'error' } without plugins
Must register plugin in flat config; ESLint 9+.

Configure ESLint flat config to lint for incorrect casing of brand names and terms.

// eslint.config.js import casePolice from 'eslint-plugin-case-police'; export default [ { plugins: { 'case-police': casePolice, }, rules: { 'case-police/no-case-police': 'error', }, }, ];
Debug
Known issues
breakingV2.0.0 drops support for .eslintrc config; requires flat config (ESLint 9+).
fix
Migrate to flat config (eslint.config.js).
affects: >=2.0.0
breakingV0.7.0 drops support for ESLint <9.
fix
Upgrade ESLint to version 9 or later.
affects: >=0.7.0
gotchaPlugin only checks tokens against known dictionary; does not enforce arbitrary capitalization.
fix
Extend dictionary if needed via `case-police` package or wait for upstream updates.
affects: all
Errors
Common errors & fixes
Error: Failed to load plugin 'case-police' declared in 'plugins': Cannot find module 'eslint-plugin-case-police'
Missing or incorrect plugin import in flat config.
fix
Ensure you have installed the package and imported it correctly: `import casePolice from 'eslint-plugin-case-police'`
Configuration for rule 'case-police/no-case-police' is invalid
Using .eslintrc config instead of flat config.
fix
Switch to eslint.config.js with plugins object.
TypeError: Cannot read properties of undefined (reading 'getFilename')
Plugin expects ESLint 10+ compatibility fix; ensure v2.2.0+ is installed.
fix
Update to eslint-plugin-case-police@2.2.0 or later.
Upgrade
Version history
2.2.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency; plugin requires ESLint ^9.9.0 or ^10.0.0
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-case-police — npm install eslint-plugin-case-police · libregistry