Feature/475 eslint plugin - #541
Open
ajulaybeeb wants to merge 5 commits into
Open
Conversation
…ross-runtime validation, and custom linting - Implemented Husky commit-msg and pre-push policy enforcer (Resolves Stellar-Search#476) - Created scripts/check-invariants.js to run standalone tests on pre-commit (Resolves Stellar-Search#473) - Scaffolded shared validation schema and replaced backend strkey regex (Resolves Stellar-Search#474) - Scaffolded eslint-plugin-greenpay for internal rules (Resolves Stellar-Search#475)
- Authored scripts/engine/core.js to dynamically execute and aggregate invariant rules - Implemented scripts/engine/baseline.js to support .invariant-baseline.json suppressions - Created python-rule.js adapter to natively parse check-k8s-manifests.py JSON output - Migrated check-invariants.js to act as the primary engine registry
- Created shared/validators/stellarValidator.js utilizing @stellar/stellar-sdk's StrKey - Replaced vulnerable hand-rolled regexes in backend schemas, event sourcing, and routes - Migrated extension session-state and frontend form UI to the SDK's CRC16 checksum check - Resolves Stellar-Search#474
…nal invariants - Implemented eslint-plugin-greenpay containing 4 internal AST rules - Added 'no-parsefloat-numeric' to prevent precision loss on monetary types - Added 'no-nested-envelope' to flag redundant res.data.data reads with auto-fixer - Added 'no-cross-package-imports' to enforce backend/frontend/mobile architectural boundaries - Added 'no-undeclared-reachable' check - Implemented .greenpay-eslint-baseline.json to suppress existing violations and allow gradual rollout - Resolves Stellar-Search#475
ajulaybeeb
force-pushed
the
feature/475-eslint-plugin
branch
from
August 28, 2026 12:00
b957e0d to
254e781
Compare
ajulaybeeb
force-pushed
the
feature/475-eslint-plugin
branch
from
August 28, 2026 18:40
0fac458 to
c4dbffc
Compare
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.
📌 Overview
Resolves #475.
This PR introduces
eslint-plugin-greenpay, a bespoke ESLint plugin enforcing GreenPay's internal architectural invariants and preventing common bugs like precision loss on monetary variables. It also ships a baseline suppression engine to allow immediate adoption without needing a big-bang conversion of all existing legacy violations.🔍 Technical Approach
no-parsefloat-numeric(Money Rule),no-nested-envelope(Envelope Rule with auto-fix),no-cross-package-imports, andno-undeclared-reachableusing ESLint AST visitors.lib/utils/baseline.jswhich wrapscontext.reportto gracefully squelch diagnostics for files mapped in.greenpay-eslint-baseline.json.tests/index.test.jsrule-testing harness proving out true-positives gathered from real commits and false-positive cases.plugin:greenpay/recommendeddirectly into thebackend/andfrontend/.eslintrc.jsonfiles.🧪 Testing & Verification
node tests/index.test.jspasses all rule unit tests.parseFloat()sites inside thebackend/do not throw lint errors due to the active baseline suppression.