FEC-753: Add shared no-direct-currency formatting rule#3961
Merged
Conversation
…g in ESLint config
…updated usage instructions and allowlist customization
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: b4e2921 The changes in this PR will be included in the next version bump. This PR includes changesets to release 36 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3961 +/- ##
==========================================
+ Coverage 71.91% 72.61% +0.70%
==========================================
Files 263 264 +1
Lines 6801 7016 +215
Branches 2104 2192 +88
==========================================
+ Hits 4891 5095 +204
- Misses 1889 1898 +9
- Partials 21 23 +2
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…lude <FormattedNumber /> from react-intl
Use Jest projects in jest.test.config.js so custom ESLint rule tests run in a node environment alongside the existing jsdom test suite.
Covers intl.formatNumber, destructured/aliased variants, Intl.NumberFormat, variable-resolved options, spread elements, and <FormattedNumber /> from react-intl. Includes cases proving the false-positive bug where non-currency <FormattedNumber /> usage (percent, decimal, no style) is incorrectly flagged.
The eslint-rules project inherits Babel config resolution which loads
babel-plugin-istanbul, conflicting with Jest's own coverage instrumentation.
Setting transform: {} avoids this since the rule files are plain CommonJS.
…JSX attribute handling
misama-ct
approved these changes
Apr 8, 2026
rajrdk
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds a bundled ESLint rule no-direct-currency-formatting to
@commercetools-frontend/eslint-config-mc-app, exposed via@commercetools-frontend/eslint-config-mc-app/rules.Description
Right now, the ESLint rule only exists in the Merchant Center frontend repo, so to have one common place and avoid repeating it across repos, we centralize it here to prevent incorrect money formatting usage.