Browse Source

Added support for eslint and prettier using airbnb config

Arnaud Vergnet 1 year ago
parent
commit
2aac20ccee
3 changed files with 811 additions and 300 deletions
  1. 37
    1
      .eslintrc.js
  2. 762
    295
      package-lock.json
  3. 12
    4
      package.json

+ 37
- 1
.eslintrc.js View File

@@ -1,4 +1,40 @@
1 1
 module.exports = {
2 2
   root: true,
3
-  extends: '@react-native-community',
3
+  extends: [
4
+    'airbnb',
5
+    'plugin:flowtype/recommended',
6
+    'prettier',
7
+    'prettier/flowtype',
8
+    'prettier/react',
9
+  ],
10
+  parser: 'babel-eslint',
11
+  plugins: ['flowtype'],
12
+  env: {
13
+    jest: true,
14
+  },
15
+  rules: {
16
+    'flowtype/define-flow-type': 1,
17
+    'flowtype/no-mixed': 2,
18
+    'flowtype/no-primitive-constructor-types': 2,
19
+    'flowtype/no-types-missing-file-annotation': 2,
20
+    'flowtype/no-weak-types': 2,
21
+    'flowtype/require-parameter-type': 2,
22
+    'flowtype/require-readonly-react-props': 0,
23
+    'flowtype/require-return-type': [
24
+      2,
25
+      'always',
26
+      {
27
+        annotateUndefined: 'never',
28
+      },
29
+    ],
30
+    'flowtype/require-valid-file-annotation': 2,
31
+    'flowtype/type-id-match': [2, '^([A-Z][a-z0-9]+)+Type$'],
32
+    'flowtype/use-flow-type': 1,
33
+    'flowtype/valid-syntax': 1,
34
+  },
35
+  settings: {
36
+    flowtype: {
37
+      onlyFilesWithFlowAnnotation: false,
38
+    },
39
+  },
4 40
 };

+ 762
- 295
package-lock.json
File diff suppressed because it is too large
View File


+ 12
- 4
package.json View File

@@ -57,11 +57,19 @@
57 57
     "react-navigation-header-buttons": "^5.0.0"
58 58
   },
59 59
   "devDependencies": {
60
-    "@babel/core": "^7.8.4",
61
-    "@babel/runtime": "^7.8.4",
62
-    "@react-native-community/eslint-config": "^1.1.0",
60
+    "@babel/core": "^7.11.0",
61
+    "@babel/preset-flow": "^7.10.4",
62
+    "@babel/runtime": "^7.11.0",
63
+    "babel-eslint": "^10.1.0",
63 64
     "babel-jest": "^25.1.0",
64
-    "eslint": "6.5.1",
65
+    "eslint": "^7.2.0",
66
+    "eslint-config-airbnb": "^18.2.0",
67
+    "eslint-config-prettier": "^6.11.0",
68
+    "eslint-plugin-flowtype": "^5.2.0",
69
+    "eslint-plugin-import": "^2.22.0",
70
+    "eslint-plugin-jsx-a11y": "^6.3.1",
71
+    "eslint-plugin-react": "^7.20.5",
72
+    "eslint-plugin-react-hooks": "^4.0.0",
65 73
     "flow-bin": "^0.123.0",
66 74
     "jest": "^25.1.0",
67 75
     "jest-extended": "^0.11.5",

Loading…
Cancel
Save