An ESLint plugin that enables project-specific rules from a local eslint-local-rules.js file, similar to the deprecated --rulesdir CLI option. Current stable version is 3.0.2, with releases about every 6-12 months. Supports npm/yarn/pnpm workspaces, TypeScript via ts-node, and provides all/all-warn configs. Key differentiators: minimal setup, automatic discovery of local rules, and workspace-aware rule resolution. Minimum Node 12.
npm install eslint-plugin-local-rulesVerified import paths — ran on the pinned version, not inferred.
Shows how to define a local rule in eslint-local-rules.js and enable it via ESLint config.
If using workspaces, ensure you run ESLint from the workspace subdirectory, not the project root, especially when a workspace-level rules file exists.
Run ESLint from the workspace directory (e.g., cd src/app && npx eslint index.js) to pick up workspace-specific rules.
Add `compilerOptions: { module: 'commonjs' }` to ts-node.register() call in eslint-local-rules/index.js.Use Node.js 12 or higher.
Run `npm install eslint-plugin-local-rules --save-dev` in your project.
Create an eslint-local-rules.js file in your project root (or in the workspace directory when using workspaces).
Ensure each rule has both a `meta` object and a `create` function: `{ meta: { ... }, create(context) { return { ... } } }`.