6472 - feat(new-plugin): add @docusaurus/eslint-plugin for i18n and best practices#11807
6472 - feat(new-plugin): add @docusaurus/eslint-plugin for i18n and best practices#11807Byte-Architect-ot wants to merge 1 commit intofacebook:mainfrom
Conversation
…tices - Add no-dynamic-i18n-messages rule - Add no-untranslated-text rule - Add recommended config - Add tests Closes facebook#6514
|
Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@docusaurus/eslint-plugin
ESLint plugin for detecting internationalization (i18n) issues in Docusaurus projects.
This plugin helps ensure that all user-facing text is properly prepared for translation and that translation messages can be statically extracted.
Motivation
Sometimes text labels in the repository are accidentally left untranslated (see issue #4542).
This plugin introduces ESLint rules to automatically detect such cases during development.
This PR resolves #6472.
Installation
or
Usage
Add the plugin to your ESLint configuration.
Rules
no-dynamic-i18n-messages
Ensures that all
translate()calls and<Translate>components use static string literals.Dynamic values prevent static extraction of translation strings.
Bad
Good
no-untranslated-text
Ensures that all user-facing text in JSX is wrapped with
<Translate>ortranslate().This helps catch accidentally untranslated text.
Bad
Good
or
Benefits