-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: use eslint-doc-generator for rule documentation #1263
Conversation
This sounds really cool! I'll have a proper look when I've got some time, but two initial thoughts:
|
@G-Rath yes, I am planning to support both of those, see these issues: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay, this is awesome! stoked to see this land when Gareth is happy 🙂
Hmm, weird CI failure needs to be investigated |
3a72a8b
to
2d0b4ad
Compare
72a18ba
to
db9881e
Compare
db9881e
to
191fb0b
Compare
I implemented a feature to separate the type-checking rules list with Still need to investigate the CI failure. |
b5b1a46
to
9209b14
Compare
The CI failure has been fixed by ensuring we build before running the generator. This PR is ready for review. Note that I plan to implement this feature eventually but would prefer not to block the PR on it: |
1c69d98
to
977ecd5
Compare
422bac9
to
b3b6a70
Compare
b3b6a70
to
bd2c7bf
Compare
Just a heads up that this PR is still ready. I'm just updating it whenever I publish a new version of the tool. |
sweet - I'll try and have a look over the weekend; thanks again for your work on this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff! I have some mild feelings about if we really need so many columns in the table (i.e. the "Warn" and "fix vs suggest" specifically), but other maintainers don't seem mind and hey this is exactly what I was hoping for in the long run with my regenerate-docs
script 😂
The good news is that the columns are configurable. I filed an issue to consider a consolidated column for fixable/suggestions: bmish/eslint-doc-generator#207. For the configuration columns, I've gone through multiple iterations of it and the current design of a separate column per configured rule severity is by far the most scalable and robust solution I've reached. I didn't find a good way to represent different severities in a single config column. |
I built this CLI tool eslint-doc-generator for automating the generation of the README rules list and rule doc title/notices for ESLint plugins. It follows common documentation conventions from this and other top ESLint plugins and will help us standardize documentation across ESLint plugins (and generally improve the usability of our custom rules through better documentation and streamline the process of adding new rules).
This is a follow-up to the work I did to add the original notices in #1226 (and thanks @G-Rath and @SimenB for helping to inspire it). eslint-doc-generator is significantly more robust compared to the previous documentation generator script/tests which I have now removed. It has much more functionality (for example, the rules list legend is auto-generated, and the rules list will show additional columns of information when applicable) and 100% test coverage.
There are some discrepancies between the old docs and the new docs. Most of these are intentional and likely improvements. If you don't like any of the changes, let me know and I can tweak eslint-doc-generator or add a config option to support the desired behavior.
Some differences include:
all
config is hidden everywhere as a result of the--ignore-config all
option### Default configuration
section header from some rule docs which was confusing because it was used for rules with no config/options (and causes the options section check to fail)