Registry / devops / eslint-rule-docs

eslint-rule-docs

JSON →
library1.1.235jsnpmunverified

A utility library (v1.1.235) that returns the documentation URL for a given ESLint rule, supporting both core rules and known plugins. Updated daily via cron job to keep plugin mappings current. Differentiates itself from manual lookup by providing exact-match URLs for core rules, per-plugin documentation for known plugins (e.g., React, Flowtype), and fallback to repository URL or empty object for unknown plugins. Works in Node.js with CommonJS/ESM.

npm install eslint-rule-docs
INSTALL
IMPORT
SIG · ESLINT-RULE-DOCS
E
eslint-rule-docs
devopsjavascriptv1.1.235
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 (getRuleUrl)
import getRuleUrl from 'eslint-rule-docs'
const { getRuleUrl } = require('eslint-rule-docs')
The default export is a function. Named export 'getRuleUrl' does not exist; must use default import or require.
default (getRuleUrl) via require
const getRuleUrl = require('eslint-rule-docs')
const { default: getRuleUrl } = require('eslint-rule-docs')
CommonJS require gives the function directly, not an object with default property.
TypeScript types
getRuleUrl has no types; use @types/eslint-rule-docs or inline definition
Package does not ship TypeScript types. Use a .d.ts file or rely on inference.

Demonstrates usage to get rule documentation URLs for core ESLint rules, plugin rules, and unknown rules.

const getRuleUrl = require('eslint-rule-docs'); const coreResult = getRuleUrl('no-undef'); console.log(coreResult); // { exactMatch: true, url: 'https://eslint.org/docs/rules/no-undef' } const pluginResult = getRuleUrl('react/sort-prop-types'); console.log(pluginResult); // { exactMatch: true, url: 'https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md' } const unknownResult = getRuleUrl('unknown-foo/bar'); console.log(unknownResult); // {}
Debug
Known issues
gotchaThe rule name must be exactly as ESLint expects (e.g., 'no-undef', not 'no_undef').
fix
Use the official rule name (kebab-case for core rules, slash-separated for plugins).
affects: >=1.0.0
gotchaPlugin rules are only supported if the plugin is known to the library; unknown plugins return an empty object.
fix
Check if result has an 'exactMatch' property or a 'url' property to determine if it was found.
affects: >=1.0.0
gotchaURLs for core rules point to eslint.org/docs/rules/, which may change if ESLint updates its documentation structure.
fix
Do not rely on the URL being permanent; always fetch the latest version of the library.
affects: >=1.0.0
deprecatedThe package may rely on outdated mappings for deprecated ESLint rules.
fix
Check ESLint core rules documentation for removed rules; the library may still return old URLs.
affects: >=1.0.0
gotchaThe library only returns one URL per rule; it does not support multiple documentation sources.
fix
If you need multiple URLs, consider additional sources or fork the package.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'eslint-rule-docs'
Package not installed or not in node_modules.
fix
Run `npm install eslint-rule-docs`
getRuleUrl is not a function
Wrong import style: imported as named export instead of default.
fix
Use `import getRuleUrl from 'eslint-rule-docs'` or `const getRuleUrl = require('eslint-rule-docs')`
TypeError: getRuleUrl is not a function
Attempted to destructure import incorrectly, e.g., `const { getRuleUrl } = require('eslint-rule-docs')`.
fix
Import default: `import getRuleUrl from 'eslint-rule-docs'`
{} returned for a rule I know exists
Plugin is not included in the library's mapping.
fix
Check the list of supported plugins; if missing, contribute to the database or use the fallback manual URL.
Upgrade
Version history
1.1.235latest on npm
Audit
Dependencies

No dependency data recorded yet.

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