Discover Performance Issues Using Vega ESLint Plugin
The eslint-plugin-kepler
provides automated linting rules for Vega apps, helping you discover and fix performance issues.
Install and configure the plugin
-
Install the Vega ESLint plugin:
npm install --save-dev @amazon-devices/eslint-plugin-kepler
- Configure ESLint in your project:
-
Update
extends
andplugins
of your.eslintrc
configuration file:{ "extends": [ "@react-native", "eslint:recommended", "plugin:@amazon-devices/eslint-plugin-kepler/performance" // add the extension ], "plugins": [ "@typescript-eslint", "@amazon-devices/kepler" //include the plugin ], "parserOptions": { "project": "./tsconfig.json" }, "parser": "@typescript-eslint/parser" }
-
(Optional) You can customize lint rules to suit your requirements as described in configure rules in ESLint document. See ESLint rules for all rules provided by this plugin.
-
Specify custom formatter in
package.json
:{ "scripts": { : "lint": "eslint src test --ext .ts,.tsx --format node_modules/@amazon-devices/eslint-plugin-kepler/dist/formatters/default.js", : } }
-
-
Run the linter:
npm run lint
You can see result on the console:
Console displays output after running the linter In addition to the console output, the linter generates HTML report, too:
Vega ESLint performance report You can check these linter warning on VS code while you’re editing the code:
Linter warning
ESLint Rules
Rule Name | Default severity | Description | Best Practice |
---|---|---|---|
@amazon-devices/kepler/flat-list | Warn - flags issues but doesn't fail builds | Checks if FlatList element has enough properties | FlatList |
@amazon-devices/kepler/check-subscription | Warn - flags issues but doesn't fail builds | Checks if callbacks installed by useAddVegaAppStateListenerCallback and useAddUserInputListenerCallback are properly unsubscribed | Listeners, event subscriptions, and timers |
@amazon-devices/kepler/animated | Error - flags issues and fails build | Checks if Animated element component uses native driver | The Animated library |
@amazon-devices/kepler/detect-report-fully-drawn | Warn - flags issues but doesn't fail builds | Checks if useReportFullyDrawn() is invoked properly | Fully drawn marker |
@amazon-devices/kepler/detect-splash-screen | Warn - flags issues but doesn't fail builds | Checks if usePreventHideSplashScreen() and useHideSplashScreenCallback() is invoked properly. | SplashScreenManager |
Related topics
Last updated: Sep 30, 2025