{"id":19996,"library":"eslint-rule-docs","title":"eslint-rule-docs","description":"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.","status":"active","version":"1.1.235","language":"javascript","source_language":"en","source_url":"https://github.com/stefanbuck/eslint-rule-docs","tags":["javascript","eslint","eslint-plugin","docs","documenation","rules","rule"],"install":[{"cmd":"npm install eslint-rule-docs","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-rule-docs","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-rule-docs","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The default export is a function. Named export 'getRuleUrl' does not exist; must use default import or require.","wrong":"const { getRuleUrl } = require('eslint-rule-docs')","symbol":"default (getRuleUrl)","correct":"import getRuleUrl from 'eslint-rule-docs'"},{"note":"CommonJS require gives the function directly, not an object with default property.","wrong":"const { default: getRuleUrl } = require('eslint-rule-docs')","symbol":"default (getRuleUrl) via require","correct":"const getRuleUrl = require('eslint-rule-docs')"},{"note":"Package does not ship TypeScript types. Use a .d.ts file or rely on inference.","wrong":"","symbol":"TypeScript types","correct":"getRuleUrl has no types; use @types/eslint-rule-docs or inline definition"}],"quickstart":{"code":"const getRuleUrl = require('eslint-rule-docs');\n\nconst coreResult = getRuleUrl('no-undef');\nconsole.log(coreResult);\n// { exactMatch: true, url: 'https://eslint.org/docs/rules/no-undef' }\n\nconst pluginResult = getRuleUrl('react/sort-prop-types');\nconsole.log(pluginResult);\n// { exactMatch: true, url: 'https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md' }\n\nconst unknownResult = getRuleUrl('unknown-foo/bar');\nconsole.log(unknownResult);\n// {}","lang":"javascript","description":"Demonstrates usage to get rule documentation URLs for core ESLint rules, plugin rules, and unknown rules."},"warnings":[{"fix":"Use the official rule name (kebab-case for core rules, slash-separated for plugins).","message":"The rule name must be exactly as ESLint expects (e.g., 'no-undef', not 'no_undef').","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check if result has an 'exactMatch' property or a 'url' property to determine if it was found.","message":"Plugin rules are only supported if the plugin is known to the library; unknown plugins return an empty object.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Do not rely on the URL being permanent; always fetch the latest version of the library.","message":"URLs for core rules point to eslint.org/docs/rules/, which may change if ESLint updates its documentation structure.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check ESLint core rules documentation for removed rules; the library may still return old URLs.","message":"The package may rely on outdated mappings for deprecated ESLint rules.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"If you need multiple URLs, consider additional sources or fork the package.","message":"The library only returns one URL per rule; it does not support multiple documentation sources.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'commonjs/esm':75 'core':21,48 'cron':29 'current':35 'daili':27 'differenti':36 'doc':4,81 'documen':82 'document':12,53 'e.g':57 'empti':66 'eslint':2,17,77,79 'eslint-plugin':78 'eslint-rule-doc':1 'exact':44 'exact-match':43 'fallback':61 'flowtyp':59 'given':16 'javascript':76 'job':30 'keep':32 'known':24,55 'librari':7 'lookup':40 'manual':39 'map':34 'match':45 'node.js':73 'object':67 'per':51 'per-plugin':50 'plugin':25,33,52,56,70,80 'provid':42 'react':58 'repositori':63 'return':10 'rule':3,18,22,49,83,84 'support':19 'unknown':69 'updat':26 'url':13,46,64 'util':6 'v1.1.235':8 'via':28 'work':71","created_at":"2026-04-25T11:20:46.863703+00:00","updated_at":"2026-04-25T11:20:46.863703+00:00","problems":[{"fix":"Run `npm install eslint-rule-docs`","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'eslint-rule-docs'"},{"fix":"Use `import getRuleUrl from 'eslint-rule-docs'` or `const getRuleUrl = require('eslint-rule-docs')`","cause":"Wrong import style: imported as named export instead of default.","error":"getRuleUrl is not a function"},{"fix":"Import default: `import getRuleUrl from 'eslint-rule-docs'`","cause":"Attempted to destructure import incorrectly, e.g., `const { getRuleUrl } = require('eslint-rule-docs')`.","error":"TypeError: getRuleUrl is not a function"},{"fix":"Check the list of supported plugins; if missing, contribute to the database or use the fallback manual URL.","cause":"Plugin is not included in the library's mapping.","error":"{} returned for a rule I know exists"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/stefanbuck/eslint-rule-docs","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-rule-docs","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}