feat(docusaurus-types): Add UnusedDirective: 'throw' for markdown#11079
feat(docusaurus-types): Add UnusedDirective: 'throw' for markdown#11079heysujal wants to merge 1 commit into
Conversation
Signed-off-by: Sujal Gupta <sujalgupta6100@gmail.com>
✅ [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
|
slorber
left a comment
There was a problem hiding this comment.
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.
example sites are generated and shouldn't be modified
There was a problem hiding this comment.
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.
You can test your changes on our own website in website/docusaurus.config.ts
|
|
||
| export type RouterType = 'browser' | 'hash'; | ||
|
|
||
| export type SiteConfig = { |
There was a problem hiding this comment.
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
customFieldshereTest links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs