Registry / devops / eslint-rule-documentation

eslint-rule-documentation

JSON →
library1.0.23jsnpmunverified

A utility to retrieve the documentation URL for any ESLint rule, including core rules and many popular plugin rules. Current version 1.0.23 supports dozens of plugins like eslint-plugin-import, jest, react, typescript, and more. Updated periodically with contributions. Differentiates by being lightweight and community-driven for plugin URL mappings, unlike built-in ESLint lookups.

npm install eslint-rule-documentation
INSTALL
IMPORT
SIG · ESLINT-RULE-DOCUME
E
eslint-rule-documentation
devopsjavascriptv1.0.23
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
const getRuleURI = require('eslint-rule-documentation');
import getRuleURI from 'eslint-rule-documentation';
Package uses CommonJS; no named exports. If using ES modules, use createRequire or dynamic import().
getRuleURI
const getRuleURI = require('eslint-rule-documentation');
import { getRuleURI } from 'eslint-rule-documentation';
Function is default export only; destructured import will fail.
getRuleURI
import getRuleURI from 'eslint-rule-documentation'; // With esm shim
const getRuleURI = require('eslint-rule-documentation').default;
In CommonJS, .default is undefined; use plain require().

Shows basic usage: get documentation URL for a core ESLint rule and a plugin rule.

const getRuleURI = require('eslint-rule-documentation'); console.log(getRuleURI('no-var')); // { found: true, url: 'https://eslint.org/docs/rules/no-var' } console.log(getRuleURI('import/no-unresolved')); // { found: true, url: 'https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md' }
Debug
Known issues
gotchaThe function returns an object with `found` and `url`; check `found` before using `url` to avoid linking to contribution page.
fix
Always check `result.found` before using `result.url`.
affects: >=1.0.0
breakingVersion 1.0.15: throws if ruleId is not a string (previously returned an object with found=false).
fix
Ensure ruleId is a string: `getRuleURI(String(ruleId))`.
affects: >=1.0.15
deprecatedNo deprecations known, but many plugin URLs change; the package may not always be up-to-date.
fix
Check the plugin's actual docs or contribute updates to eslint-rule-documentation's plugins.json.
affects: all
Errors
Common errors & fixes
TypeError: getRuleURI is not a function
Using mismatched import style (e.g., import { getRuleURI } from '...') in CommonJS.
fix
Use `const getRuleURI = require('eslint-rule-documentation');`
TypeError: ruleId must be a string
Passing a non-string argument (e.g., number, object) to getRuleURI.
fix
Ensure ruleId is a string: `getRuleURI(String(ruleId))`
Cannot find module 'eslint-rule-documentation'
Package not installed in node_modules.
fix
Run `npm install eslint-rule-documentation` or `yarn add eslint-rule-documentation`.
Upgrade
Version history
1.0.23latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
eslint-rule-documentation — npm install eslint-rule-documentation · libregistry