@amazon-devices/eslint-plugin-kepler 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +71 -0
- package/THIRD_PARTY_NOTICES.txt +4229 -0
- package/dist/formatters/default.js +8 -0
- package/dist/formatters/default.js.LICENSE.txt +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 Amazon.com, Inc. or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
These materials are licensed as "Program Materials" under the Program Materials License Agreement (the "Agreement"). The Agreement is available at https://developer.amazon.com/support/legal/pml. See the Agreement for the specific terms and conditions of the Agreement. Capitalized terms not defined in this file have the meanings given to them in the Agreement.
|
|
4
|
+
|
|
5
|
+
If you do not agree to the above terms and conditions, you may not use any file in this package.
|
|
6
|
+
|
|
7
|
+
YOUR USE OF THE PROGRAM MATERIALS IN OR ASSOCIATED WITH THIS PACKAGE IS AT YOUR SOLE RISK. IN NO EVENT WILL AMAZON BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES (INCLUDING FOR ANY LOSS OF GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS OR DATA, OR COMPUTER FAILURE OR MALFUNCTION) ARISING FROM OR RELATING TO SUCH PROGRAM MATERIALS, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, EVEN IF AMAZON HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS AND DISCLAIMERS APPLY EXCEPT TO THE EXTENT PROHIBITED BY APPLICABLE LAW.
|
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
|
|
2
|
+
# eslint-plugin-kepler
|
|
3
|
+
|
|
4
|
+
An ESLint Plugin to suggest Kepler App Development best practices.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
1. Make sure that you can access kepler NPM repo: See [Start installing SDK](https://developer.amazon.com/docs/kepler/install-kepler-sdk.html).
|
|
8
|
+
2. Add this package to `devDependencies` section of `package.json`:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install --save-dev @amazon-devices/eslint-plugin-kepler
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Set up
|
|
15
|
+
|
|
16
|
+
To use Kepler ESLint Plugin, complete the below steps in your Kepler App Project.
|
|
17
|
+
|
|
18
|
+
1. Configure Kepler rules in the App's eslint config
|
|
19
|
+
|
|
20
|
+
KeplerESLintPlugin provides default configs that can be directly imported in App projects. To do so, add the following configuration in Kepler App's ESLint config file `.eslintrc.js`.
|
|
21
|
+
|
|
22
|
+
``` javascript
|
|
23
|
+
module.exports = {
|
|
24
|
+
plugins: ["@amazon-devices/eslint-plugin-kepler"],
|
|
25
|
+
extends: ["plugin:@amazon-devices/eslint-plugin-kepler/performance"],
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
You can also override severity of specific rules according do your use case like below
|
|
30
|
+
```javascript
|
|
31
|
+
module.exports = {
|
|
32
|
+
plugins: ["@amazon-devices/eslint-plugin-kepler"],
|
|
33
|
+
extends: ["plugin:@amazon-devices/eslint-plugin-kepler/performance"],
|
|
34
|
+
rules: {
|
|
35
|
+
"@amazon-devices/kepler/flat-list": "error",
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
2. Specify formatter on lint tasks:
|
|
41
|
+
```javascript
|
|
42
|
+
"scripts": {
|
|
43
|
+
:
|
|
44
|
+
"lint": "eslint src test --ext .ts,.tsx --format node_modules/@amazon-devices/eslint-plugin-kepler/dist/formatters/default.js",
|
|
45
|
+
"lint:fix": "eslint src test --ext .ts,.tsx --fix --format node_modules/@amazon-devices/eslint-plugin-kepler/dist/formatters/default.js",
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
3. Run Kepler ESLint Plugin
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
$ npm run lint
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Example:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
$ npm run lint
|
|
58
|
+
|
|
59
|
+
> @amazon-devices/kepler-eslint-testapp@0.1.0 lint
|
|
60
|
+
> eslint src test --ext .ts,.tsx --format node_modules/@amazon-devices/eslint-plugin-kepler/dist/formatters/default.js
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/Volumes/workspace/KeplerESLint/src/KeplerESLintTestApp/src/components/Link.tsx
|
|
64
|
+
32:5 ❌ 'useNativeDriver' property is set to 'false'. Set useNativeDriver to 'true' to run animations on UI thread for better performance. See https://developer.amazon.com/docs/kepler-tv/best_practices.html#animations for more. @amazon-devices/kepler/animated
|
|
65
|
+
43:5 ⚠️ Subscription must be kept in variable so that it can be cleaned up on the component is detached. See https://developer.amazon.com/docs/kepler-tv/best_practices.html#listeners-event-subscriptions-and-timers for more. @amazon-devices/kepler/check-subscription
|
|
66
|
+
64:11 ⚠️ FlatList missing props: 'initialNumToRender,windowSize,removeClippedSubviews,maxToRenderPerBatch,updateCellsBatchingPeriod'. FlatList performance is not fully unlocked without these props. See https://developer.amazon.com/docs/kepler-tv/best_practices.html#flatlist for more. @amazon-devices/kepler/flat-list
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
4. Kepler ESLint Plugin generated warnings will show in VS Code Editor when [ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) is installed.
|
|
70
|
+
|
|
71
|
+

|