-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore(website): automate the addition of rule attributes to the website #5085
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
Conversation
Thanks for the PR, @bradzacher! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
b6d1221
to
1bc2c80
Compare
/* indent the nested checklist for the rule doc attributes */ | ||
ul.contains-task-list > li > ul.contains-task-list { | ||
padding-left: 24px; | ||
} |
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.
This has been fixed by facebook/docusaurus#7438
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.
We can rebase and remove this now.
I kind of hate having this information right there in the docs cos it feels long and feels like it gets in the way. Two ideas:
|
const requiresTypeInfo = rule.meta.docs?.requiresTypeChecking === true; | ||
|
||
const parent = root as mdast.Parent; | ||
/* |
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.
I found the package that does this for us:
import { fromMarkdown } from "mdast-util-from-markdown";
fromMarkdown(`## Attributes
...
`);
Especially since we're going to automate more of this page, I feel like that's a good approach?
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.
Woop! 🚀
Codecov Report
@@ Coverage Diff @@
## main #5085 +/- ##
==========================================
+ Coverage 91.70% 93.83% +2.12%
==========================================
Files 362 286 -76
Lines 12181 9838 -2343
Branches 3530 2939 -591
==========================================
- Hits 11171 9231 -1940
+ Misses 661 328 -333
+ Partials 349 279 -70
Flags with carried forward coverage won't be shown. Click here to find out more. |
I'll punt on the parsing and the structure for now so that others can continue their work on the website. |
PR Checklist
Overview
@JoshuaKGoldberg and I hacked on this during the stream today.
This adds a remark plugin to our docusaurus config which automatically generates the "Attributes" section on each of the rule doc pages.
This is great because it removes the need for a test and manual maintenance!
All of the rule docs are markdown files that are automatically loaded into the website via mdx. Because we don't have a component that wraps these, Josh and I thought that using a remark plugin seemed like the best way to make this happen.
If someone with docusaurus experience knows a better way - please let me know! This worked, but it seems kind-of hacky?