Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
eslint-doc-generator
Advanced tools
Automatic documentation generator for ESLint plugins and rules.
Generates the following documentation based on ESLint and top ESLint plugin conventions:
Also performs some basic section consistency checks on rule docs (will eventually be configurable):
## Options
section and mentions each named option (for rules with options)Install it:
npm i --save-dev eslint-doc-generator
Add it as as script in package.json
(included as a lint script to demonstrate how we can ensure it passes and is up-to-date on CI):
{
"scripts": {
"lint": "npm-run-all \"lint:*\"",
"lint:docs": "markdownlint \"**/*.md\"",
"lint:eslint-docs": "npm-run-all update:docs && git diff --exit-code",
"lint:js": "eslint .",
"update:eslint-docs": "eslint-doc-generator"
}
}
Delete any old rules list from your README.md
. A new one will be automatically added to your ## Rules
section (along with the following marker comments if they don't already exist):
<!-- begin rules list -->
<!-- end rules list -->
Delete any old recommended/fixable/etc notices from your rule docs. A new title and notices will be automatically added to the top of each rule doc (along with a marker comment if it doesn't exist yet).
Run the script from package.json
:
npm run update:eslint-docs
Generated content in a rule doc (everything above the marker comment):
# Disallow use of `foo` (`no-foo`)
💼 This rule is enabled in the following configs: `all`, `recommended`.
🔧 This rule is automatically fixable using the `--fix` [option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions) that can be applied manually.
❌ This rule is deprecated. It was replaced by [some-new-rule](some-new-rule.md).
<!-- end rule header -->
Description.
## Examples
Examples.
...
Generated rules table in README.md
(everything between the marker comments):
# eslint-plugin-test
## Rules
✅: Enabled in the `recommended` configuration.\
🔧: Fixable with [`eslint --fix`](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems).\
💡: Provides editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).\
💭: Requires type information.\
❌: This rule is deprecated.
<!-- begin rules list -->
| Rule | Description | ✅ | 🔧 | 💡 | 💭 |
| -------------------------------------------------------------- | ------------------------------------------------- | --- | --- | --- | --- |
| [max-nested-describe](docs/rules/max-nested-describe.md) | Enforces a maximum depth to nested describe calls | | | | |
| [no-alias-methods](docs/rules/no-alias-methods.md) | Disallow alias methods | ✅ | 🔧 | | |
| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | Disallow commented out tests | ✅ | | | |
<!-- end rules list -->
...
Note the emoji legend you'll want to provide above the rules list.
If you have any custom configs (besides all
, recommended
), you'll need to define a badge for them at the bottom of your README.md
. Here's a badge for a custom style
config that displays in blue:
[style]: https://img.shields.io/badge/-style-blue.svg
FAQs
Automatic documentation generator for ESLint plugins and rules.
We found that eslint-doc-generator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.