@globalpayments/eslint-plugin-vega-eslint
v1.2.22
Published
Eslint Plugin Package for Vega project
Readme
vega-eslint
Eslint plugin for vega project
Installation
You'll first need to install ESLint:
npm i eslint --save-devNext, install @globalpayments/eslint-plugin-vega-eslint:
npm install @globalpayments/eslint-plugin-vega-eslint --save-devUsage
Add @globalpayments/vega-eslint to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"@globalpayments/vega-eslint"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"@globalpayments/vega-eslint/rule-name": 2
}
}Supported Rules
For a full list of available rules, see:
- Documentation:
docs/rules/— detailed description and examples for each rule - Source:
src/rules/— rule implementations
Testing
The plugin includes a comprehensive test suite built with Vitest. Tests ensure all rules work correctly and maintain high code coverage.
Running Tests
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Watch mode for development
npm run test:watchFor testing guidance, see the test files in tests/rules/.
Development
Build
To build the package, please run
npm run buildPublish
Automatic (recommended)
Every push (or merged PR) to main automatically:
- Bumps the patch version in
package.json - Builds the package
- Publishes to the npm registry
- Pushes the version-bump commit and git tag back to
main
This is powered by the GitHub Actions workflow at .github/workflows/publish.yml.
Prerequisites – add the following repository secret in
Settings → Secrets and variables → Actions:| Secret | Description | |---------------------|----------------------------------------------| |
NPM_TOKEN_GLOBALPAYMENTS| npm Granular Access Token with read-write permission scoped to@globalpayments/eslint-plugin-vega-eslint|
⚠️ Token Rotation – npm Granular Access Tokens expire after 90 days (max).
Set a calendar reminder to rotate the token every ~80 days:
- Generate a new token:
npm token create --name "vega-eslint-ci" --expires 90 --packages "@globalpayments/eslint-plugin-vega-eslint" --packages-and-scopes-permission read-write --bypass-2fa- Update the
NPM_TOKEN_GLOBALPAYMENTSsecret in GitHub → Settings → Secrets and variables → Actions- Revoke the old token:
npm token revoke <old-token-id>
