Browse Source

config eslint

iou90 6 years ago
parent
commit
15d694077d
4 changed files with 1120 additions and 3 deletions
  1. 41
    0
      .eslintrc.json
  2. 0
    1
      autoHeightWebView/index.android.js
  3. 9
    1
      package.json
  4. 1070
    1
      yarn.lock

+ 41
- 0
.eslintrc.json View File

@@ -0,0 +1,41 @@
1
+{
2
+    "env": {
3
+        "browser": true,
4
+        "commonjs": true,
5
+        "es6": true,
6
+        "node": true
7
+    },
8
+    "parser": "babel-eslint",
9
+    "parserOptions": {
10
+        "ecmaVersion": 8,
11
+        "ecmaFeatures": {
12
+            "jsx": true,
13
+            "experimentalObjectRestSpread": true
14
+        },
15
+        "sourceType": "module"
16
+    },
17
+    "rules": {
18
+        "no-const-assign": "error",
19
+        "no-undef": "error",
20
+        "no-unused-vars": "warn",
21
+        "no-this-before-super": "warn",
22
+        "no-unreachable": "warn",
23
+        "constructor-super": "warn",
24
+        "valid-typeof": "warn",
25
+        "react-native/no-unused-styles": "warn",
26
+        "react-native/split-platform-components": "warn",
27
+        "react-native/no-inline-styles": "off",
28
+        "react-native/no-color-literals": "off"
29
+    },
30
+    "plugins": [
31
+        "react",
32
+        "jsx-a11y",
33
+        "react-native"
34
+    ],
35
+    "extends": [
36
+        "eslint:recommended",
37
+        "plugin:react/recommended",
38
+        "plugin:react-native/all",
39
+        "plugin:jsx-a11y/recommended"
40
+    ]
41
+}

+ 0
- 1
autoHeightWebView/index.android.js View File

@@ -11,7 +11,6 @@ import {
11 11
   StyleSheet,
12 12
   Platform,
13 13
   UIManager,
14
-  View,
15 14
   ViewPropTypes,
16 15
   WebView
17 16
 } from 'react-native';

+ 9
- 1
package.json View File

@@ -33,5 +33,13 @@
33 33
   "dependencies": {
34 34
     "immutable": "^3.8.1",
35 35
     "prop-types": "^15.5.10"
36
+  },
37
+  "devDependencies": {
38
+    "babel-eslint": "^8.2.2",
39
+    "eslint": "^4.18.1",
40
+    "eslint-plugin-jsx": "^0.0.2",
41
+    "eslint-plugin-jsx-a11y": "^6.0.3",
42
+    "eslint-plugin-react": "^7.7.0",
43
+    "eslint-plugin-react-native": "^3.2.1"
36 44
   }
37
-}
45
+}

+ 1070
- 1
yarn.lock
File diff suppressed because it is too large
View File