{"id":19704,"library":"eslint-plugin-case-police","title":"eslint-plugin-case-police","description":"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.","status":"active","version":"2.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/antfu/case-police","tags":["javascript","eslint","eslint-plugin","typescript"],"install":[{"cmd":"npm install eslint-plugin-case-police","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-case-police","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-case-police","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin requires ESLint ^9.9.0 or ^10.0.0","package":"eslint","optional":false}],"imports":[{"note":"ESM-only since v2; CommonJS require works but is not recommended.","wrong":"const casePolice = require('eslint-plugin-case-police')","symbol":"default","correct":"import casePolice from 'eslint-plugin-case-police'"},{"note":"Default export is the plugin object; named export does not exist.","wrong":"import { casePolice } from 'eslint-plugin-case-police'","symbol":"plugin","correct":"import casePolice from 'eslint-plugin-case-police'"},{"note":"Must register plugin in flat config; ESLint 9+.","wrong":"rules: { 'case-police/no-case-police': 'error' } without plugins","symbol":"rule in flat config","correct":"plugins: { 'case-police': casePolice }, rules: { 'case-police/no-case-police': 'error' }"}],"quickstart":{"code":"// eslint.config.js\nimport casePolice from 'eslint-plugin-case-police';\n\nexport default [\n  {\n    plugins: {\n      'case-police': casePolice,\n    },\n    rules: {\n      'case-police/no-case-police': 'error',\n    },\n  },\n];\n","lang":"javascript","description":"Configure ESLint flat config to lint for incorrect casing of brand names and terms."},"warnings":[{"fix":"Migrate to flat config (eslint.config.js).","message":"V2.0.0 drops support for .eslintrc config; requires flat config (ESLint 9+).","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade ESLint to version 9 or later.","message":"V0.7.0 drops support for ESLint <9.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Extend dictionary if needed via `case-police` package or wait for upstream updates.","message":"Plugin only checks tokens against known dictionary; does not enforce arbitrary capitalization.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure you have installed the package and imported it correctly: `import casePolice from 'eslint-plugin-case-police'`","cause":"Missing or incorrect plugin import in flat config.","error":"Error: Failed to load plugin 'case-police' declared in 'plugins': Cannot find module 'eslint-plugin-case-police'"},{"fix":"Switch to eslint.config.js with plugins object.","cause":"Using .eslintrc config instead of flat config.","error":"Configuration for rule 'case-police/no-case-police' is invalid"},{"fix":"Update to eslint-plugin-case-police@2.2.0 or later.","cause":"Plugin expects ESLint 10+ compatibility fix; ensure v2.2.0+ is installed.","error":"TypeError: Cannot read properties of undefined (reading 'getFilename')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}