-
-
Notifications
You must be signed in to change notification settings - Fork 9k
feat(docusaurus-types): Add UnusedDirective: 'throw' for markdown #11079
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
Signed-off-by: Sujal Gupta <[email protected]>
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
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'm not sure what you are trying to do 😅 but adding TS types is not enough to implement this feature, you have to also use JS to implement the behavior we want, ensure the new config attribute is properly validated (configValidation.ts
), add unit tests for this new feature
siteConfig: { | ||
markdown: { | ||
onUnusedDirective: 'throw' | ||
} | ||
}, |
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.
example sites are generated and shouldn't be modified
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 added this to test my changes. I will remove these eventually. I was looking for help with testing my changes for the screenshot I have attached.
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.
You can test your changes on our own website in website/docusaurus.config.ts
@@ -19,6 +19,10 @@ export type ReportingSeverity = 'ignore' | 'log' | 'warn' | 'throw'; | |||
|
|||
export type RouterType = 'browser' | 'hash'; | |||
|
|||
export type SiteConfig = { |
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 already have a DocusaurusConfig
type and MarkdownConfig
type
Pre-flight checklist
Closes: #10674
Motivation
This PR adds a directive which can be added to config to throw error if there are unused directive in the markdown. At the moment we have ability to only show warnings for it.
#9394
Test Plan
I am trying to add the same config in example classic and while doing so I am getting this error.
I don't think I need to use
customFields
hereTest links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs