Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: Docusaurus ESLint plugin to enforce best Docusaurus practices #7206
feat: Docusaurus ESLint plugin to enforce best Docusaurus practices #7206
Changes from 3 commits
52f00e4
e6ac161
e48d6e1
5375beb
e33bcd2
19a7f89
7ae0e64
aa58521
8776087
3d5ecd0
9f04ae1
05e2fed
492615f
3fd35d6
05a5f3c
35ef3b2
beabcf4
ecdc3bd
d1d9add
50f0de4
40cfd23
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It would be useful to add an option
ignoreJSXAttributes
. We may want to flag<div aria-label="untranslated" />
as well. Doesn't have to be in this PR thoughThere 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 didn't understand that, could you provide an example usage of
ignoreJSXAttributes
? Also what is the purpose of<div aria-label="untranslated" />
? Self-closing tags do not have children (excluding the children prop) therefore the current rules do not apply in this case, right ?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.
Oh, sorry, wrong comment place. I was talking about
no-untranslated-text
. There should be an option that turns on warning for JSX attributes likearia-label
as well, not just string literal children.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 think this is fine for now, but in the long term, we may need to first check the imported name because it may not be imported as
Translate
(cf ourtranslationExtractor
implementation). I'm not aware if we can let ESLint do a two-round traverse in an efficient way—I think people usually useProgram:exit
?