eslint-plugin-kepler, provides automated linting rules for Vega apps, helping you discover and fix performance, compatibility, and accessibility issues.
Prerequisites
Install the plugin and its dependencies:Configure the plugin
-
Update
extends,plugins, andoverridessections of your.eslintrcconfiguration file:Thekeplerconfiguration includes all Vega rules. To use a subset of rules, extend one or more of these configurations instead:performance- Performance-related rules onlysystem-distributed-libs- System distributed library checks only (package.jsonvalidation and import informational flagging)accessibility- Accessibility rules only
To use only the accessibility rules:Save the file. ESLint now loads the Vega rules the next time you run the linter. - (Optional) To customize lint rules, follow ESLint’s configure rules guide. If you skip this step, all rules run at their default severities. For rules provided by the Vega ESLint plugin, see Understand the performance rules, Understand the system distributed library rules, and Understand the accessibility rules.
-
Specify the custom formatter in the
lintscript of yourpackage.jsonfile:Yourlintscript now uses the Vega custom formatter. -
Run the linter:
If
package.jsonwarnings don’t appear, confirmjsonc-eslint-parseris installed and thatpackage.jsonis passed to theeslintcommand. You can see the result on the console:
The linter also generates an HTML report:
You can check these linter warnings on VS Code while hovering over your code:
Understand the performance rules
The following rules help identify common performance issues in Vega apps and enforce best practices for optimal runtime performance. In the rule tables on this page, anError rule flags issues and fails the build. A Warn rule flags issues but doesn’t fail the build.
Understand the system distributed library rules
The following rules detect system distributed library usage and guide you on proper implementation.(Optional) configure semantic version guidance
The system distributed library rules check semantic versioning in yourpackage.json dependencies. By default, the plugin uses auto mode to detect your project’s versioning settings.
Override the default by setting the semverGuidance option:
- Patch only mode (
semverGuidance: "patch"): Restricts updates to patches using~prefix. - Minor and patch mode (
semverGuidance: "minor"): Allows minor updates using^prefix. - Auto mode (
semverGuidance: "auto"): Detects settings based on project signatures in the project repo. This is the default.
Understand the accessibility rules
The following rules flag components that assistive technologies, such as screen readers, can’t describe or operate correctly. For guidance on the accessibility props these rules check, see Accessibility for React Native 0.83 or React Native 0.72.
To change the severity of an accessibility rule, override it in the
rules section of your ESLint configuration:
(Optional) configure VS Code for JSON validation
If you want to see errors and warnings in VS Code’spackage.json, add json to these settings.json entries:
Related topics
- ESLint Official Documentation
- Find and Fix Accessibility Issues in Vega Studio
- Accessibility Resources for Vega Developers

