Allows a local ESLint rules directory to be used without the --rulesdir command-line flag. Version 0.2.2 is experimental and its API may change. It requires manual configuration by setting the RULES_DIR property on the plugin object before use. Unlike eslint-plugin-local-rules, which scans for a local directory automatically, rulesdir provides explicit control over which directories to load rules from. Works with Node >=4.0.0 and ESLint.
npm install eslint-plugin-rulesdirVerified import paths — ran on the pinned version, not inferred.
Shows how to set up eslint-plugin-rulesdir with a local rules directory and configure a custom rule.
Ensure the require() and assignment to RULES_DIR happens at the top level of your config file, before module.exports.
Use 'rulesdir' in the plugins array.
Pin to a specific version and monitor the repository for breaking changes.
Use absolute paths or ensure cwd consistency with process.chdir() or --cwd flag.
If using an older version, only strings are accepted. Upgrade to 0.2.0+ for array support.
Run 'npm install eslint-plugin-rulesdir --save-dev' in your project directory.
Ensure the package is installed and the require path is correct: const rulesDirPlugin = require('eslint-plugin-rulesdir');Verify that the rule file exists at the specified path relative to cwd. Check RULES_DIR assignment.
Use 'error' as a string (ESLint >= 3.0.0 supports strings) or number 2. Check your ESLint version.
No dependency data recorded yet.