Browse Source

Update project config files to use TypeScript

Arnaud Vergnet 3 years ago
parent
commit
54486d1deb
6 changed files with 403 additions and 67 deletions
  1. 3
    43
      .eslintrc.js
  2. 0
    0
      .flowconfig
  3. 6
    1
      babel.config.js
  4. 316
    16
      package-lock.json
  5. 16
    7
      package.json
  6. 62
    0
      tsconfig.json

+ 3
- 43
.eslintrc.js View File

@@ -1,46 +1,6 @@
1 1
 module.exports = {
2 2
   root: true,
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
-    'react/jsx-filename-extension': [1, {extensions: ['.js', '.jsx']}],
17
-    'react/static-property-placement': [2, 'static public field'],
18
-    'flowtype/define-flow-type': 1,
19
-    'flowtype/no-mixed': 2,
20
-    'flowtype/no-primitive-constructor-types': 2,
21
-    'flowtype/no-types-missing-file-annotation': 2,
22
-    'flowtype/no-weak-types': 2,
23
-    'flowtype/require-parameter-type': 2,
24
-    'flowtype/require-readonly-react-props': 0,
25
-    'flowtype/require-return-type': [
26
-      2,
27
-      'always',
28
-      {
29
-        annotateUndefined: 'never',
30
-      },
31
-    ],
32
-    'flowtype/require-valid-file-annotation': 2,
33
-    'flowtype/type-id-match': [2, '^([A-Z][a-z0-9]+)+Type$'],
34
-    'flowtype/use-flow-type': 1,
35
-    'flowtype/valid-syntax': 1,
36
-  },
37
-  settings: {
38
-    flowtype: {
39
-      onlyFilesWithFlowAnnotation: false,
40
-    },
41
-  },
42
-  globals: {
43
-    fetch: false,
44
-    Headers: false,
45
-  },
3
+  extends: '@react-native-community',
4
+  parser: '@typescript-eslint/parser',
5
+  plugins: ['@typescript-eslint'],
46 6
 };

+ 0
- 0
.flowconfig View File


+ 6
- 1
babel.config.js View File

@@ -1,3 +1,8 @@
1 1
 module.exports = {
2
-  presets: ['module:metro-react-native-babel-preset', '@babel/preset-flow'],
2
+  presets: ['module:metro-react-native-babel-preset'],
3
+  env: {
4
+    production: {
5
+      plugins: ['react-native-paper/babel'],
6
+    },
7
+  },
3 8
 };

+ 316
- 16
package-lock.json View File

@@ -810,16 +810,6 @@
810 810
         "@babel/helper-plugin-utils": "^7.10.4"
811 811
       }
812 812
     },
813
-    "@babel/preset-flow": {
814
-      "version": "7.10.4",
815
-      "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.10.4.tgz",
816
-      "integrity": "sha512-XI6l1CptQCOBv+ZKYwynyswhtOKwpZZp5n0LG1QKCo8erRhqjoQV6nvx61Eg30JHpysWQSBwA2AWRU3pBbSY5g==",
817
-      "dev": true,
818
-      "requires": {
819
-        "@babel/helper-plugin-utils": "^7.10.4",
820
-        "@babel/plugin-transform-flow-strip-types": "^7.10.4"
821
-      }
822
-    },
823 813
     "@babel/register": {
824 814
       "version": "7.10.5",
825 815
       "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.10.5.tgz",
@@ -2297,6 +2287,79 @@
2297 2287
       "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-4.10.1.tgz",
2298 2288
       "integrity": "sha512-ael2f1onoPF3vF7YqHGWy7NnafzGu+yp88BbFbP0ydoCP2xGSUzmZVw0zakPTC040Id+JQ9WeFczujMkDy6jYQ=="
2299 2289
     },
2290
+    "@react-native-community/eslint-config": {
2291
+      "version": "1.1.0",
2292
+      "resolved": "https://registry.npmjs.org/@react-native-community/eslint-config/-/eslint-config-1.1.0.tgz",
2293
+      "integrity": "sha512-hwb1hC28BhkwLwnO6vDISV6XZbipw2RIEhBVBN+pE7AUG9HjFXxoksiiOSoYgox9C8g86VJwHnKpak/3NnVBkQ==",
2294
+      "dev": true,
2295
+      "requires": {
2296
+        "@react-native-community/eslint-plugin": "^1.1.0",
2297
+        "@typescript-eslint/eslint-plugin": "^2.25.0",
2298
+        "@typescript-eslint/parser": "^2.25.0",
2299
+        "babel-eslint": "10.1.0",
2300
+        "eslint-config-prettier": "^6.10.1",
2301
+        "eslint-plugin-eslint-comments": "^3.1.2",
2302
+        "eslint-plugin-flowtype": "2.50.3",
2303
+        "eslint-plugin-jest": "22.4.1",
2304
+        "eslint-plugin-prettier": "3.1.2",
2305
+        "eslint-plugin-react": "7.19.0",
2306
+        "eslint-plugin-react-hooks": "^3.0.0",
2307
+        "eslint-plugin-react-native": "3.8.1",
2308
+        "prettier": "^2.0.2"
2309
+      },
2310
+      "dependencies": {
2311
+        "doctrine": {
2312
+          "version": "2.1.0",
2313
+          "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
2314
+          "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
2315
+          "dev": true,
2316
+          "requires": {
2317
+            "esutils": "^2.0.2"
2318
+          }
2319
+        },
2320
+        "eslint-plugin-flowtype": {
2321
+          "version": "2.50.3",
2322
+          "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.50.3.tgz",
2323
+          "integrity": "sha512-X+AoKVOr7Re0ko/yEXyM5SSZ0tazc6ffdIOocp2fFUlWoDt7DV0Bz99mngOkAFLOAWjqRA5jPwqUCbrx13XoxQ==",
2324
+          "dev": true,
2325
+          "requires": {
2326
+            "lodash": "^4.17.10"
2327
+          }
2328
+        },
2329
+        "eslint-plugin-react": {
2330
+          "version": "7.19.0",
2331
+          "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.19.0.tgz",
2332
+          "integrity": "sha512-SPT8j72CGuAP+JFbT0sJHOB80TX/pu44gQ4vXH/cq+hQTiY2PuZ6IHkqXJV6x1b28GDdo1lbInjKUrrdUf0LOQ==",
2333
+          "dev": true,
2334
+          "requires": {
2335
+            "array-includes": "^3.1.1",
2336
+            "doctrine": "^2.1.0",
2337
+            "has": "^1.0.3",
2338
+            "jsx-ast-utils": "^2.2.3",
2339
+            "object.entries": "^1.1.1",
2340
+            "object.fromentries": "^2.0.2",
2341
+            "object.values": "^1.1.1",
2342
+            "prop-types": "^15.7.2",
2343
+            "resolve": "^1.15.1",
2344
+            "semver": "^6.3.0",
2345
+            "string.prototype.matchall": "^4.0.2",
2346
+            "xregexp": "^4.3.0"
2347
+          }
2348
+        },
2349
+        "eslint-plugin-react-hooks": {
2350
+          "version": "3.0.0",
2351
+          "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-3.0.0.tgz",
2352
+          "integrity": "sha512-EjxTHxjLKIBWFgDJdhKKzLh5q+vjTFrqNZX36uIxWS4OfyXe5DawqPj3U5qeJ1ngLwatjzQnmR0Lz0J0YH3kxw==",
2353
+          "dev": true
2354
+        }
2355
+      }
2356
+    },
2357
+    "@react-native-community/eslint-plugin": {
2358
+      "version": "1.1.0",
2359
+      "resolved": "https://registry.npmjs.org/@react-native-community/eslint-plugin/-/eslint-plugin-1.1.0.tgz",
2360
+      "integrity": "sha512-W/J0fNYVO01tioHjvYWQ9m6RgndVtbElzYozBq1ZPrHO/iCzlqoySHl4gO/fpCl9QEFjvJfjPgtPMTMlsoq5DQ==",
2361
+      "dev": true
2362
+    },
2300 2363
     "@react-native-community/masked-view": {
2301 2364
       "version": "0.1.10",
2302 2365
       "resolved": "https://registry.npmjs.org/@react-native-community/masked-view/-/masked-view-0.1.10.tgz",
@@ -2418,6 +2481,12 @@
2418 2481
       "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
2419 2482
       "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ=="
2420 2483
     },
2484
+    "@types/eslint-visitor-keys": {
2485
+      "version": "1.0.0",
2486
+      "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
2487
+      "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==",
2488
+      "dev": true
2489
+    },
2421 2490
     "@types/graceful-fs": {
2422 2491
       "version": "4.1.3",
2423 2492
       "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.3.tgz",
@@ -2454,6 +2523,36 @@
2454 2523
         "@types/istanbul-lib-report": "*"
2455 2524
       }
2456 2525
     },
2526
+    "@types/jest": {
2527
+      "version": "25.2.3",
2528
+      "resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.2.3.tgz",
2529
+      "integrity": "sha512-JXc1nK/tXHiDhV55dvfzqtmP4S3sy3T3ouV2tkViZgxY/zeUkcpQcQPGRlgF4KmWzWW5oiWYSZwtCB+2RsE4Fw==",
2530
+      "dev": true,
2531
+      "requires": {
2532
+        "jest-diff": "^25.2.1",
2533
+        "pretty-format": "^25.2.1"
2534
+      },
2535
+      "dependencies": {
2536
+        "pretty-format": {
2537
+          "version": "25.5.0",
2538
+          "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz",
2539
+          "integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==",
2540
+          "dev": true,
2541
+          "requires": {
2542
+            "@jest/types": "^25.5.0",
2543
+            "ansi-regex": "^5.0.0",
2544
+            "ansi-styles": "^4.0.0",
2545
+            "react-is": "^16.12.0"
2546
+          }
2547
+        }
2548
+      }
2549
+    },
2550
+    "@types/json-schema": {
2551
+      "version": "7.0.6",
2552
+      "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz",
2553
+      "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==",
2554
+      "dev": true
2555
+    },
2457 2556
     "@types/json5": {
2458 2557
       "version": "0.0.29",
2459 2558
       "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
@@ -2478,6 +2577,40 @@
2478 2577
       "integrity": "sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ==",
2479 2578
       "dev": true
2480 2579
     },
2580
+    "@types/prop-types": {
2581
+      "version": "15.7.3",
2582
+      "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
2583
+      "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==",
2584
+      "dev": true
2585
+    },
2586
+    "@types/react": {
2587
+      "version": "16.9.49",
2588
+      "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.49.tgz",
2589
+      "integrity": "sha512-DtLFjSj0OYAdVLBbyjhuV9CdGVHCkHn2R+xr3XkBvK2rS1Y1tkc14XSGjYgm5Fjjr90AxH9tiSzc1pCFMGO06g==",
2590
+      "dev": true,
2591
+      "requires": {
2592
+        "@types/prop-types": "*",
2593
+        "csstype": "^3.0.2"
2594
+      }
2595
+    },
2596
+    "@types/react-native": {
2597
+      "version": "0.63.20",
2598
+      "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.63.20.tgz",
2599
+      "integrity": "sha512-APnxRTDxbWw/IYjvwvXkhYJiz1gahyVA579pJqAVsEfZ+ZUwUHZpWKnexobyH5NmRJHuA/8LrThyps/BW3SYXA==",
2600
+      "dev": true,
2601
+      "requires": {
2602
+        "@types/react": "*"
2603
+      }
2604
+    },
2605
+    "@types/react-test-renderer": {
2606
+      "version": "16.9.3",
2607
+      "resolved": "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-16.9.3.tgz",
2608
+      "integrity": "sha512-wJ7IlN5NI82XMLOyHSa+cNN4Z0I+8/YaLl04uDgcZ+W+ExWCmCiVTLT/7fRNqzy4OhStZcUwIqLNF7q+AdW43Q==",
2609
+      "dev": true,
2610
+      "requires": {
2611
+        "@types/react": "*"
2612
+      }
2613
+    },
2481 2614
     "@types/stack-utils": {
2482 2615
       "version": "1.0.1",
2483 2616
       "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz",
@@ -2496,6 +2629,80 @@
2496 2629
       "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz",
2497 2630
       "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw=="
2498 2631
     },
2632
+    "@typescript-eslint/eslint-plugin": {
2633
+      "version": "2.34.0",
2634
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz",
2635
+      "integrity": "sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ==",
2636
+      "dev": true,
2637
+      "requires": {
2638
+        "@typescript-eslint/experimental-utils": "2.34.0",
2639
+        "functional-red-black-tree": "^1.0.1",
2640
+        "regexpp": "^3.0.0",
2641
+        "tsutils": "^3.17.1"
2642
+      }
2643
+    },
2644
+    "@typescript-eslint/experimental-utils": {
2645
+      "version": "2.34.0",
2646
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz",
2647
+      "integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==",
2648
+      "dev": true,
2649
+      "requires": {
2650
+        "@types/json-schema": "^7.0.3",
2651
+        "@typescript-eslint/typescript-estree": "2.34.0",
2652
+        "eslint-scope": "^5.0.0",
2653
+        "eslint-utils": "^2.0.0"
2654
+      }
2655
+    },
2656
+    "@typescript-eslint/parser": {
2657
+      "version": "2.34.0",
2658
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.34.0.tgz",
2659
+      "integrity": "sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA==",
2660
+      "dev": true,
2661
+      "requires": {
2662
+        "@types/eslint-visitor-keys": "^1.0.0",
2663
+        "@typescript-eslint/experimental-utils": "2.34.0",
2664
+        "@typescript-eslint/typescript-estree": "2.34.0",
2665
+        "eslint-visitor-keys": "^1.1.0"
2666
+      }
2667
+    },
2668
+    "@typescript-eslint/typescript-estree": {
2669
+      "version": "2.34.0",
2670
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz",
2671
+      "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==",
2672
+      "dev": true,
2673
+      "requires": {
2674
+        "debug": "^4.1.1",
2675
+        "eslint-visitor-keys": "^1.1.0",
2676
+        "glob": "^7.1.6",
2677
+        "is-glob": "^4.0.1",
2678
+        "lodash": "^4.17.15",
2679
+        "semver": "^7.3.2",
2680
+        "tsutils": "^3.17.1"
2681
+      },
2682
+      "dependencies": {
2683
+        "debug": {
2684
+          "version": "4.2.0",
2685
+          "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
2686
+          "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
2687
+          "dev": true,
2688
+          "requires": {
2689
+            "ms": "2.1.2"
2690
+          }
2691
+        },
2692
+        "ms": {
2693
+          "version": "2.1.2",
2694
+          "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
2695
+          "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
2696
+          "dev": true
2697
+        },
2698
+        "semver": {
2699
+          "version": "7.3.2",
2700
+          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
2701
+          "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
2702
+          "dev": true
2703
+        }
2704
+      }
2705
+    },
2499 2706
     "abab": {
2500 2707
       "version": "2.0.4",
2501 2708
       "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.4.tgz",
@@ -3554,6 +3761,12 @@
3554 3761
         }
3555 3762
       }
3556 3763
     },
3764
+    "csstype": {
3765
+      "version": "3.0.3",
3766
+      "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.3.tgz",
3767
+      "integrity": "sha512-jPl+wbWPOWJ7SXsWyqGRk3lGecbar0Cb0OvZF/r/ZU011R4YqiRehgkQ9p4eQfo9DSDLqLL3wHwfxeJiuIsNag==",
3768
+      "dev": true
3769
+    },
3557 3770
     "damerau-levenshtein": {
3558 3771
       "version": "1.0.6",
3559 3772
       "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.6.tgz",
@@ -4242,6 +4455,30 @@
4242 4455
         }
4243 4456
       }
4244 4457
     },
4458
+    "eslint-plugin-eslint-comments": {
4459
+      "version": "3.2.0",
4460
+      "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz",
4461
+      "integrity": "sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==",
4462
+      "dev": true,
4463
+      "requires": {
4464
+        "escape-string-regexp": "^1.0.5",
4465
+        "ignore": "^5.0.5"
4466
+      },
4467
+      "dependencies": {
4468
+        "escape-string-regexp": {
4469
+          "version": "1.0.5",
4470
+          "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
4471
+          "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
4472
+          "dev": true
4473
+        },
4474
+        "ignore": {
4475
+          "version": "5.1.8",
4476
+          "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz",
4477
+          "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
4478
+          "dev": true
4479
+        }
4480
+      }
4481
+    },
4245 4482
     "eslint-plugin-flowtype": {
4246 4483
       "version": "5.2.0",
4247 4484
       "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-5.2.0.tgz",
@@ -4285,6 +4522,12 @@
4285 4522
         }
4286 4523
       }
4287 4524
     },
4525
+    "eslint-plugin-jest": {
4526
+      "version": "22.4.1",
4527
+      "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.4.1.tgz",
4528
+      "integrity": "sha512-gcLfn6P2PrFAVx3AobaOzlIEevpAEf9chTpFZz7bYfc7pz8XRv7vuKTIE4hxPKZSha6XWKKplDQ0x9Pq8xX2mg==",
4529
+      "dev": true
4530
+    },
4288 4531
     "eslint-plugin-jsx-a11y": {
4289 4532
       "version": "6.3.1",
4290 4533
       "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.3.1.tgz",
@@ -4312,6 +4555,15 @@
4312 4555
         }
4313 4556
       }
4314 4557
     },
4558
+    "eslint-plugin-prettier": {
4559
+      "version": "3.1.2",
4560
+      "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz",
4561
+      "integrity": "sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA==",
4562
+      "dev": true,
4563
+      "requires": {
4564
+        "prettier-linter-helpers": "^1.0.0"
4565
+      }
4566
+    },
4315 4567
     "eslint-plugin-react": {
4316 4568
       "version": "7.20.6",
4317 4569
       "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.20.6.tgz",
@@ -4348,6 +4600,21 @@
4348 4600
       "integrity": "sha512-6SSb5AiMCPd8FDJrzah+Z4F44P2CdOaK026cXFV+o/xSRzfOiV1FNFeLl2z6xm3yqWOQEZ5OfVgiec90qV2xrQ==",
4349 4601
       "dev": true
4350 4602
     },
4603
+    "eslint-plugin-react-native": {
4604
+      "version": "3.8.1",
4605
+      "resolved": "https://registry.npmjs.org/eslint-plugin-react-native/-/eslint-plugin-react-native-3.8.1.tgz",
4606
+      "integrity": "sha512-6Z4s4nvgFRdda/1s1+uu4a6EMZwEjjJ9Bk/1yBImv0fd9U2CsGu2cUakAtV83cZKhizbWhSouXoaK4JtlScdFg==",
4607
+      "dev": true,
4608
+      "requires": {
4609
+        "eslint-plugin-react-native-globals": "^0.1.1"
4610
+      }
4611
+    },
4612
+    "eslint-plugin-react-native-globals": {
4613
+      "version": "0.1.2",
4614
+      "resolved": "https://registry.npmjs.org/eslint-plugin-react-native-globals/-/eslint-plugin-react-native-globals-0.1.2.tgz",
4615
+      "integrity": "sha512-9aEPf1JEpiTjcFAmmyw8eiIXmcNZOqaZyHO77wgm0/dWfT/oxC1SrIq8ET38pMxHYrcB6Uew+TzUVsBeczF88g==",
4616
+      "dev": true
4617
+    },
4351 4618
     "eslint-scope": {
4352 4619
       "version": "5.1.0",
4353 4620
       "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz",
@@ -4708,6 +4975,12 @@
4708 4975
       "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
4709 4976
       "dev": true
4710 4977
     },
4978
+    "fast-diff": {
4979
+      "version": "1.2.0",
4980
+      "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
4981
+      "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
4982
+      "dev": true
4983
+    },
4711 4984
     "fast-json-stable-stringify": {
4712 4985
       "version": "2.1.0",
4713 4986
       "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
@@ -4941,12 +5214,6 @@
4941 5214
       "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==",
4942 5215
       "dev": true
4943 5216
     },
4944
-    "flow-bin": {
4945
-      "version": "0.123.0",
4946
-      "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.123.0.tgz",
4947
-      "integrity": "sha512-Ylcf8YDIM/KrqtxkPuq+f8O+6sdYA2Nuz5f+sWHlp539DatZz3YMcsO1EiXaf1C11HJgpT/3YGYe7xZ9/UZmvQ==",
4948
-      "dev": true
4949
-    },
4950 5217
     "for-in": {
4951 5218
       "version": "1.0.2",
4952 5219
       "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
@@ -10032,6 +10299,15 @@
10032 10299
       "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==",
10033 10300
       "dev": true
10034 10301
     },
10302
+    "prettier-linter-helpers": {
10303
+      "version": "1.0.0",
10304
+      "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
10305
+      "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
10306
+      "dev": true,
10307
+      "requires": {
10308
+        "fast-diff": "^1.1.2"
10309
+      }
10310
+    },
10035 10311
     "pretty-format": {
10036 10312
       "version": "24.9.0",
10037 10313
       "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz",
@@ -11907,6 +12183,15 @@
11907 12183
       "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
11908 12184
       "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q=="
11909 12185
     },
12186
+    "tsutils": {
12187
+      "version": "3.17.1",
12188
+      "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz",
12189
+      "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==",
12190
+      "dev": true,
12191
+      "requires": {
12192
+        "tslib": "^1.8.1"
12193
+      }
12194
+    },
11910 12195
     "tunnel-agent": {
11911 12196
       "version": "0.6.0",
11912 12197
       "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
@@ -11956,6 +12241,12 @@
11956 12241
         "is-typedarray": "^1.0.0"
11957 12242
       }
11958 12243
     },
12244
+    "typescript": {
12245
+      "version": "3.9.7",
12246
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
12247
+      "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
12248
+      "dev": true
12249
+    },
11959 12250
     "ua-parser-js": {
11960 12251
       "version": "0.7.21",
11961 12252
       "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.21.tgz",
@@ -12375,6 +12666,15 @@
12375 12666
       "resolved": "https://registry.npmjs.org/xpipe/-/xpipe-1.0.5.tgz",
12376 12667
       "integrity": "sha1-jdi/Rfw/f1Xw4FS4ePQ6YmFNr98="
12377 12668
     },
12669
+    "xregexp": {
12670
+      "version": "4.3.0",
12671
+      "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz",
12672
+      "integrity": "sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==",
12673
+      "dev": true,
12674
+      "requires": {
12675
+        "@babel/runtime-corejs3": "^7.8.3"
12676
+      }
12677
+    },
12378 12678
     "xtend": {
12379 12679
       "version": "4.0.2",
12380 12680
       "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",

+ 16
- 7
package.json View File

@@ -8,12 +8,17 @@
8 8
     "android-release": "react-native run-android --variant=release",
9 9
     "ios": "react-native run-ios",
10 10
     "test": "jest",
11
-    "lint": "eslint ."
11
+    "lint": "eslint . --ext .js,.jsx,.ts,.tsx"
12 12
   },
13 13
   "jest": {
14 14
     "preset": "react-native",
15
-    "transformIgnorePatterns": [
16
-      "node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base)"
15
+    "moduleFileExtensions": [
16
+      "ts",
17
+      "tsx",
18
+      "js",
19
+      "jsx",
20
+      "json",
21
+      "node"
17 22
     ],
18 23
     "setupFilesAfterEnv": [
19 24
       "jest-extended"
@@ -59,9 +64,13 @@
59 64
   },
60 65
   "devDependencies": {
61 66
     "@babel/core": "^7.11.0",
62
-    "@babel/preset-flow": "^7.10.4",
63 67
     "@babel/runtime": "^7.11.0",
64
-    "babel-eslint": "^10.1.0",
68
+    "@react-native-community/eslint-config": "^1.1.0",
69
+    "@types/jest": "^25.2.3",
70
+    "@types/react-native": "^0.63.2",
71
+    "@types/react-test-renderer": "^16.9.2",
72
+    "@typescript-eslint/eslint-plugin": "^2.27.0",
73
+    "@typescript-eslint/parser": "^2.27.0",
65 74
     "babel-jest": "^25.1.0",
66 75
     "eslint": "^7.2.0",
67 76
     "eslint-config-airbnb": "^18.2.0",
@@ -71,11 +80,11 @@
71 80
     "eslint-plugin-jsx-a11y": "^6.3.1",
72 81
     "eslint-plugin-react": "^7.20.5",
73 82
     "eslint-plugin-react-hooks": "^4.0.0",
74
-    "flow-bin": "^0.123.0",
75 83
     "jest": "^25.1.0",
76 84
     "jest-extended": "^0.11.5",
77 85
     "metro-react-native-babel-preset": "^0.59.0",
78 86
     "prettier": "2.0.5",
79
-    "react-test-renderer": "16.13.1"
87
+    "react-test-renderer": "16.13.1",
88
+    "typescript": "^3.8.3"
80 89
   }
81 90
 }

+ 62
- 0
tsconfig.json View File

@@ -0,0 +1,62 @@
1
+
2
+{
3
+  "compilerOptions": {
4
+    /* Basic Options */
5
+    "target": "esnext",                       /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
6
+    "module": "commonjs",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
7
+    "lib": ["es6"],                           /* Specify library files to be included in the compilation. */
8
+    "allowJs": true,                          /* Allow javascript files to be compiled. */
9
+    // "checkJs": true,                       /* Report errors in .js files. */
10
+    "jsx": "react-native",                    /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
11
+    // "declaration": true,                   /* Generates corresponding '.d.ts' file. */
12
+    // "sourceMap": true,                     /* Generates corresponding '.map' file. */
13
+    // "outFile": "./",                       /* Concatenate and emit output to single file. */
14
+    // "outDir": "./",                        /* Redirect output structure to the directory. */
15
+    // "rootDir": "./",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
16
+    // "removeComments": true,                /* Do not emit comments to output. */
17
+    "noEmit": true,                           /* Do not emit outputs. */
18
+    // "incremental": true,                   /* Enable incremental compilation */
19
+    // "importHelpers": true,                 /* Import emit helpers from 'tslib'. */
20
+    // "downlevelIteration": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
21
+    "isolatedModules": true,                  /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
22
+
23
+    /* Strict Type-Checking Options */
24
+    "strict": true,                           /* Enable all strict type-checking options. */
25
+    // "noImplicitAny": true,                 /* Raise error on expressions and declarations with an implied 'any' type. */
26
+    // "strictNullChecks": true,              /* Enable strict null checks. */
27
+    // "strictFunctionTypes": true,           /* Enable strict checking of function types. */
28
+    // "strictPropertyInitialization": true,  /* Enable strict checking of property initialization in classes. */
29
+    // "noImplicitThis": true,                /* Raise error on 'this' expressions with an implied 'any' type. */
30
+    // "alwaysStrict": true,                  /* Parse in strict mode and emit "use strict" for each source file. */
31
+
32
+    /* Additional Checks */
33
+    // "noUnusedLocals": true,                /* Report errors on unused locals. */
34
+    // "noUnusedParameters": true,            /* Report errors on unused parameters. */
35
+    // "noImplicitReturns": true,             /* Report error when not all code paths in function return a value. */
36
+    // "noFallthroughCasesInSwitch": true,    /* Report errors for fallthrough cases in switch statement. */
37
+
38
+    /* Module Resolution Options */
39
+    "moduleResolution": "node",               /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
40
+    // "baseUrl": "./",                       /* Base directory to resolve non-absolute module names. */
41
+    // "paths": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
42
+    // "rootDirs": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */
43
+    // "typeRoots": [],                       /* List of folders to include type definitions from. */
44
+    // "types": [],                           /* Type declaration files to be included in compilation. */
45
+    "allowSyntheticDefaultImports": true,     /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
46
+    "esModuleInterop": true,                  /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
47
+    // "preserveSymlinks": true,              /* Do not resolve the real path of symlinks. */
48
+    "resolveJsonModule": true                 /* Allow import of JSON files */
49
+    /* Source Map Options */
50
+    // "sourceRoot": "./",                    /* Specify the location where debugger should locate TypeScript files instead of source locations. */
51
+    // "mapRoot": "./",                       /* Specify the location where debugger should locate map files instead of generated locations. */
52
+    // "inlineSourceMap": true,               /* Emit a single file with source maps instead of having a separate file. */
53
+    // "inlineSources": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
54
+
55
+    /* Experimental Options */
56
+    // "experimentalDecorators": true,        /* Enables experimental support for ES7 decorators. */
57
+    // "emitDecoratorMetadata": true,         /* Enables experimental support for emitting type metadata for decorators. */
58
+  },
59
+  "exclude": [
60
+    "node_modules", "babel.config.js", "metro.config.js", "jest.config.js"
61
+  ]
62
+}

Loading…
Cancel
Save