-
Notifications
You must be signed in to change notification settings - Fork 216
Update Javascript linting config to specify expected text domain #4578
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
Update Javascript linting config to specify expected text domain #4578
Conversation
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.
Pull Request Overview
This PR improves JavaScript translation handling by enforcing consistent text domain usage through ESLint configuration. It ensures all translatable strings use the correct woocommerce-gateway-stripe
text domain.
- Adds ESLint rule to enforce
woocommerce-gateway-stripe
text domain for all JavaScript translations - Fixes three incorrect text domain usages in existing code
- Excludes non-source directories from linting to improve performance
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
.eslintrc.js | Adds i18n text domain rule and excludes build/vendor directories from linting |
client/stripe-utils/cash-app-limit-notice-handler.js | Adds missing text domain parameter to translation function |
client/settings/stripe-account-connected-notice/index.js | Corrects text domain from 'woocommerce' to 'woocommerce-gateway-stripe' |
client/settings/general-settings-section/payment-method-checkbox.js | Adds missing text domain parameter to translation function |
readme.txt | Documents the fix in changelog |
changelog.txt | Documents the fix in changelog |
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.
Nice fix, Dale. Changes look good 👍
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.
LGTM 🚢
Merging, as the e2e test failures look unrelated to these changes. |
Towards STRIPE-453
Changes proposed in this Pull Request:
This PR tackles three closely related linting improvements:
@wordpress/i18n-text-domain
rule in our Javascript linting configuration, and we have it configured to require thewoocommerce-gateway-stripe
text domain.build/
node_modules/
phpunit-html/
release/
vendor/
Testing instructions
Inspect the translation changes and verify that they look correct
Check out this branch locally
Run
npx eslint . --ext=js,jsx,ts,tsx
and verify that it completes quickly and no errors are reportedManually modify one call to
__()
in a Javascript file to specify no text domain, and another to specify an incorrect text domainRun
npx eslint . --ext=js,jsx,ts,tsx
and verify that both changes above are flagged due to the incorrect text domain.Changelog entry
Changelog Entry Comment
Comment
Post merge