Repository navigation
Add rule no-imported-number-format-library (GCI535) - #84
Merged
utarwyn merged 8 commits intoMay 18, 2026
Merged
Conversation
Nephtys
force-pushed
the
challenge-int-format
branch
2 times, most recently
from
May 20, 2025 16:02
561fd15 to
80cfc07
Compare
fbezagu
force-pushed
the
challenge-int-format
branch
from
May 21, 2025 13:02
a635200 to
b93f455
Compare
fbezagu
force-pushed
the
challenge-int-format
branch
from
May 21, 2025 13:10
b93f455 to
634590d
Compare
...Handle numbro library only
- install the project - run Sonar scanner manually with proper host
Nephtys
force-pushed
the
challenge-int-format
branch
from
May 21, 2025 13:12
634590d to
80220c7
Compare
utarwyn
force-pushed
the
challenge-int-format
branch
from
March 8, 2026 14:06
b93079e to
1bf5f19
Compare
utarwyn
marked this pull request as ready for review
May 18, 2026 13:51
There was a problem hiding this comment.
Pull request overview
This PR introduces a new eco-design lint rule (GCI535) to discourage using external number-formatting libraries for lightweight formatting tasks, preferring native Intl.NumberFormat, and wires the rule into the Sonar JavaScript profile and project documentation.
Changes:
- Added ESLint rule
@creedengo/no-imported-number-format-librarywith unit tests and documentation. - Added Sonar hook class
NoImportedNumberFormatLibraryand registered it inCheckList. - Enabled rule key
GCI535in the Sonar JavaScript profile and added a test-project example + changelog entry.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test-project/src/no-imported-number-format-library.js | Adds sample compliant/non-compliant code for the new rule. |
| sonar-plugin/src/main/resources/org/greencodeinitiative/creedengo/profiles/javascript_profile.json | Activates GCI535 in the JS profile. |
| sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoImportedNumberFormatLibrary.java | Adds Sonar EslintHook mapping for the new rule key. |
| sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/CheckList.java | Registers the new hook in the Sonar plugin checklist. |
| eslint-plugin/tests/lib/rules/no-imported-number-format-library.test.js | Adds ESLint RuleTester coverage for the new rule. |
| eslint-plugin/README.md | Documents the new rule in the rules table. |
| eslint-plugin/lib/rules/no-imported-number-format-library.js | Implements the new ESLint rule logic (numbro/numerable detection). |
| eslint-plugin/docs/rules/no-imported-number-format-library.md | Adds rule documentation and examples. |
| CHANGELOG.md | Adds an Unreleased changelog entry for GCI535. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
utarwyn
force-pushed
the
challenge-int-format
branch
from
May 18, 2026 14:22
2b67b88 to
2324c44
Compare
utarwyn
approved these changes
May 18, 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.
Importing an external library for lightweight operations increases overall size of the program.
Using native methods instead reduces the amount of memory and storage to run and store the application.
This is especially critical in environments with limited resources, such as on mobile devices or in web applications
where bandwidth and download times matter.
Smaller programs generally have better runtime performance.
Reducing the number of unnecessary modules minimizes the amount of code that needs to be interpreted or compiled,
leading to faster execution and improved overall performance.
It also increases the maintainability and security of your program by depending on less external dependencies.