diff --git a/.eslintrc b/.eslintrc index d09bfda8..09e61fed 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,13 +1,13 @@ { "extends": "@callstack", "rules": { - "react-native/no-raw-text": 0, "no-console": 1, - "react/no-multi-comp": 0, // Ignore certain webpack alias because it can't be resolved "import/no-unresolved": [2, { "ignore": ["^@theme", "^@docusaurus", "^@generated"] }], + "react/no-multi-comp": 0, "react-native/no-color-literals": "off", "react-native/no-inline-styles": "off", + "react-native/no-raw-text": 0, "react-native-a11y/has-valid-accessibility-descriptors": "off", "react-native-a11y/has-valid-accessibility-ignores-invert-colors": 0, "react-native-a11y/has-valid-accessibility-value": "off" diff --git a/babel.config.js b/babel.config.js index a21450b2..bbc2ccfb 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,17 +1,23 @@ module.exports = { presets: [ - '@babel/preset-typescript', - '@babel/preset-react', [ '@babel/preset-env', { targets: { - node: '14', + node: '18', }, - bugfixes: true, + useBuiltIns: false, + modules: 'commonjs', }, ], + [ + '@babel/preset-react', + // { runtime: 'automatic' }, + ], + '@babel/preset-typescript', + '@babel/preset-flow', ], + plugins: ['@babel/plugin-transform-strict-mode'], env: { test: { presets: ['@react-native/babel-preset'], diff --git a/package.json b/package.json index d186d5be..e5d5cf6e 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "devDependencies": { "@babel/cli": "^7.25.9", "@babel/core": "^7.25.9", - "@babel/plugin-transform-flow-strip-types": "^7.25.9", + "@babel/plugin-transform-strict-mode": "^7.24.7", "@babel/preset-env": "^7.25.9", "@babel/preset-flow": "^7.25.9", "@babel/preset-react": "^7.25.9", @@ -78,9 +78,9 @@ "@types/react": "^18.3.12", "@types/react-test-renderer": "^18.3.0", "babel-jest": "^29.7.0", + "babel-plugin-module-resolver": "^5.0.2", "del-cli": "^6.0.0", "eslint": "^8.57.1", - "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-prettier": "^4.2.1", "flow-bin": "~0.170.0", "jest": "^29.7.0", diff --git a/yarn.lock b/yarn.lock index 10a58669..4e79c01f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -108,6 +108,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.25.6": + version: 7.25.6 + resolution: "@babel/generator@npm:7.25.6" + dependencies: + "@babel/types": "npm:^7.25.6" + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" + jsesc: "npm:^2.5.1" + checksum: 10c0/f89282cce4ddc63654470b98086994d219407d025497f483eb03ba102086e11e2b685b27122f6ff2e1d93b5b5fa0c3a6b7e974fbf2e4a75b685041a746a4291e + languageName: node + linkType: hard + "@babel/helper-annotate-as-pure@npm:^7.25.9": version: 7.25.9 resolution: "@babel/helper-annotate-as-pure@npm:7.25.9" @@ -235,6 +247,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-plugin-utils@npm:^7.24.7": + version: 7.24.8 + resolution: "@babel/helper-plugin-utils@npm:7.24.8" + checksum: 10c0/0376037f94a3bfe6b820a39f81220ac04f243eaee7193774b983e956c1750883ff236b30785795abbcda43fac3ece74750566830c2daa4d6e3870bb0dff34c2d + languageName: node + linkType: hard + "@babel/helper-remap-async-to-generator@npm:^7.25.9": version: 7.25.9 resolution: "@babel/helper-remap-async-to-generator@npm:7.25.9" @@ -281,6 +300,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.24.8": + version: 7.24.8 + resolution: "@babel/helper-string-parser@npm:7.24.8" + checksum: 10c0/6361f72076c17fabf305e252bf6d580106429014b3ab3c1f5c4eb3e6d465536ea6b670cc0e9a637a77a9ad40454d3e41361a2909e70e305116a23d68ce094c08 + languageName: node + linkType: hard + "@babel/helper-string-parser@npm:^7.25.9": version: 7.25.9 resolution: "@babel/helper-string-parser@npm:7.25.9" @@ -288,6 +314,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/helper-validator-identifier@npm:7.24.7" + checksum: 10c0/87ad608694c9477814093ed5b5c080c2e06d44cb1924ae8320474a74415241223cc2a725eea2640dd783ff1e3390e5f95eede978bc540e870053152e58f1d651 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.25.9": version: 7.25.9 resolution: "@babel/helper-validator-identifier@npm:7.25.9" @@ -346,6 +379,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.25.6": + version: 7.25.6 + resolution: "@babel/parser@npm:7.25.6" + dependencies: + "@babel/types": "npm:^7.25.6" + bin: + parser: ./bin/babel-parser.js + checksum: 10c0/f88a0e895dbb096fd37c4527ea97d12b5fc013720602580a941ac3a339698872f0c911e318c292b184c36b5fbe23b612f05aff9d24071bc847c7b1c21552c41d + languageName: node + linkType: hard + "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.25.9": version: 7.25.9 resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.25.9" @@ -1312,6 +1356,17 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-transform-strict-mode@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/plugin-transform-strict-mode@npm:7.24.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.24.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/8414b77b2fb3e27aac50d7dfc4a9dbece203a3afa36e4708c88ec1c47c140624312073f2b194edbcfa43a2ef49ff6c6916f157bfb44192e068d94181fe81b88e + languageName: node + linkType: hard + "@babel/plugin-transform-template-literals@npm:^7.25.9": version: 7.25.9 resolution: "@babel/plugin-transform-template-literals@npm:7.25.9" @@ -1566,7 +1621,7 @@ __metadata: languageName: node linkType: hard -"@babel/traverse--for-generate-function-map@npm:@babel/traverse@^7.25.3, @babel/traverse@npm:^7.25.3, @babel/traverse@npm:^7.25.9": +"@babel/traverse--for-generate-function-map@npm:@babel/traverse@^7.25.3, @babel/traverse@npm:^7.25.9": version: 7.25.9 resolution: "@babel/traverse@npm:7.25.9" dependencies: @@ -1581,6 +1636,21 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.25.3": + version: 7.25.6 + resolution: "@babel/traverse@npm:7.25.6" + dependencies: + "@babel/code-frame": "npm:^7.24.7" + "@babel/generator": "npm:^7.25.6" + "@babel/parser": "npm:^7.25.6" + "@babel/template": "npm:^7.25.0" + "@babel/types": "npm:^7.25.6" + debug: "npm:^4.3.1" + globals: "npm:^11.1.0" + checksum: 10c0/964304c6fa46bd705428ba380bf73177eeb481c3f26d82ea3d0661242b59e0dd4329d23886035e9ca9a4ceb565c03a76fd615109830687a27bcd350059d6377e + languageName: node + linkType: hard + "@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.25.2, @babel/types@npm:^7.25.9, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4": version: 7.25.9 resolution: "@babel/types@npm:7.25.9" @@ -1591,6 +1661,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.25.6": + version: 7.25.6 + resolution: "@babel/types@npm:7.25.6" + dependencies: + "@babel/helper-string-parser": "npm:^7.24.8" + "@babel/helper-validator-identifier": "npm:^7.24.7" + to-fast-properties: "npm:^2.0.0" + checksum: 10c0/89d45fbee24e27a05dca2d08300a26b905bd384a480448823f6723c72d3a30327c517476389b7280ce8cb9a2c48ef8f47da7f9f6d326faf6f53fd6b68237bdc4 + languageName: node + linkType: hard + "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -2574,7 +2655,7 @@ __metadata: dependencies: "@babel/cli": "npm:^7.25.9" "@babel/core": "npm:^7.25.9" - "@babel/plugin-transform-flow-strip-types": "npm:^7.25.9" + "@babel/plugin-transform-strict-mode": "npm:^7.24.7" "@babel/preset-env": "npm:^7.25.9" "@babel/preset-flow": "npm:^7.25.9" "@babel/preset-react": "npm:^7.25.9" @@ -2586,9 +2667,9 @@ __metadata: "@types/react": "npm:^18.3.12" "@types/react-test-renderer": "npm:^18.3.0" babel-jest: "npm:^29.7.0" + babel-plugin-module-resolver: "npm:^5.0.2" del-cli: "npm:^6.0.0" eslint: "npm:^8.57.1" - eslint-plugin-flowtype: "npm:^8.0.3" eslint-plugin-prettier: "npm:^4.2.1" flow-bin: "npm:~0.170.0" jest: "npm:^29.7.0" @@ -2753,7 +2834,17 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:*, @types/react@npm:^18.3.12": +"@types/react@npm:*": + version: 18.3.5 + resolution: "@types/react@npm:18.3.5" + dependencies: + "@types/prop-types": "npm:*" + csstype: "npm:^3.0.2" + checksum: 10c0/548b1d3d7c2f0242fbfdbbd658731b4ce69a134be072fa83e6ab516f2840402a3f20e3e7f72e95133b23d4880ef24a6d864050dc8e1f7c68f39fa87ca8445917 + languageName: node + linkType: hard + +"@types/react@npm:^18.3.12": version: 18.3.12 resolution: "@types/react@npm:18.3.12" dependencies: @@ -2844,6 +2935,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/scope-manager@npm:8.4.0": + version: 8.4.0 + resolution: "@typescript-eslint/scope-manager@npm:8.4.0" + dependencies: + "@typescript-eslint/types": "npm:8.4.0" + "@typescript-eslint/visitor-keys": "npm:8.4.0" + checksum: 10c0/95188c663df7db106529c6b93c4c7c61647ed34ab6dd48114e41ddf49140ff606c5501ce2ae451a988ec49b5d3874ea96ff212fc102802327b10affd2ff80a37 + languageName: node + linkType: hard + "@typescript-eslint/type-utils@npm:8.11.0": version: 8.11.0 resolution: "@typescript-eslint/type-utils@npm:8.11.0" @@ -2866,6 +2967,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:8.4.0": + version: 8.4.0 + resolution: "@typescript-eslint/types@npm:8.4.0" + checksum: 10c0/15e09ced84827c349553530a31822f06ae5bad456c03d561b7d0c64b6ad9b5d7ca795e030bd93e65d5a2cd41bfde36ed08dcd2ff9feaa8b60a67080827f47ecb + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:8.11.0": version: 8.11.0 resolution: "@typescript-eslint/typescript-estree@npm:8.11.0" @@ -2885,7 +2993,26 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.11.0, @typescript-eslint/utils@npm:^6.0.0 || ^7.0.0 || ^8.0.0": +"@typescript-eslint/typescript-estree@npm:8.4.0": + version: 8.4.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.4.0" + dependencies: + "@typescript-eslint/types": "npm:8.4.0" + "@typescript-eslint/visitor-keys": "npm:8.4.0" + debug: "npm:^4.3.4" + fast-glob: "npm:^3.3.2" + is-glob: "npm:^4.0.3" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/170702b024121cff9268f53de8054796b0ce025f9a78d6f2bc850a360e5f3f7032ba3ee9d4b7392726308273a5f3ade5ab31b1788b504b514bc15afc07302b37 + languageName: node + linkType: hard + +"@typescript-eslint/utils@npm:8.11.0": version: 8.11.0 resolution: "@typescript-eslint/utils@npm:8.11.0" dependencies: @@ -2899,6 +3026,20 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/utils@npm:^6.0.0 || ^7.0.0 || ^8.0.0": + version: 8.4.0 + resolution: "@typescript-eslint/utils@npm:8.4.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@typescript-eslint/scope-manager": "npm:8.4.0" + "@typescript-eslint/types": "npm:8.4.0" + "@typescript-eslint/typescript-estree": "npm:8.4.0" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + checksum: 10c0/8c9c36b3aa23f9bcc28cc4b10f0fa2996f1bc6cdd75135f08c2ef734baa30dbd2a8b92f344b90518e1fd07a486936734789fc7e90b780221a7707dad8e9c9364 + languageName: node + linkType: hard + "@typescript-eslint/visitor-keys@npm:8.11.0": version: 8.11.0 resolution: "@typescript-eslint/visitor-keys@npm:8.11.0" @@ -2909,6 +3050,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:8.4.0": + version: 8.4.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.4.0" + dependencies: + "@typescript-eslint/types": "npm:8.4.0" + eslint-visitor-keys: "npm:^3.4.3" + checksum: 10c0/339199b7fbb9ac83b530d03ab25f6bc5ceb688c9cd0ae460112cd14ee78ca7284a845aef5620cdf70170980123475ec875e85ebf595c60255ba3c0d6fe48c714 + languageName: node + linkType: hard + "@ungap/structured-clone@npm:^1.2.0": version: 1.2.0 resolution: "@ungap/structured-clone@npm:1.2.0" @@ -3325,6 +3476,19 @@ __metadata: languageName: node linkType: hard +"babel-plugin-module-resolver@npm:^5.0.2": + version: 5.0.2 + resolution: "babel-plugin-module-resolver@npm:5.0.2" + dependencies: + find-babel-config: "npm:^2.1.1" + glob: "npm:^9.3.3" + pkg-up: "npm:^3.1.0" + reselect: "npm:^4.1.7" + resolve: "npm:^1.22.8" + checksum: 10c0/ccbb9e673c4219f68937349267521becb72be292cf30bf70b861c3e709d24fbfa589da0bf6c100a0def799d38199299171cb6eac3fb00b1ea740373e2c1fe54c + languageName: node + linkType: hard + "babel-plugin-polyfill-corejs2@npm:^0.4.10": version: 0.4.11 resolution: "babel-plugin-polyfill-corejs2@npm:0.4.11" @@ -5336,6 +5500,15 @@ __metadata: languageName: node linkType: hard +"find-babel-config@npm:^2.1.1": + version: 2.1.2 + resolution: "find-babel-config@npm:2.1.2" + dependencies: + json5: "npm:^2.2.3" + checksum: 10c0/c9151b23d636378eae11aa761b0af41d5f67d5479e3ebfca7b0ec7feef91723f14242d243342783b89e6c51fc5b4120086eacf5d8a1a335cf7bae4b0ac89f493 + languageName: node + linkType: hard + "find-cache-dir@npm:^2.0.0": version: 2.1.0 resolution: "find-cache-dir@npm:2.1.0" @@ -5707,6 +5880,18 @@ __metadata: languageName: node linkType: hard +"glob@npm:^9.3.3": + version: 9.3.5 + resolution: "glob@npm:9.3.5" + dependencies: + fs.realpath: "npm:^1.0.0" + minimatch: "npm:^8.0.2" + minipass: "npm:^4.2.4" + path-scurry: "npm:^1.6.1" + checksum: 10c0/2f6c2b9ee019ee21dc258ae97a88719614591e4c979cb4580b1b9df6f0f778a3cb38b4bdaf18dfa584637ea10f89a3c5f2533a5e449cf8741514ad18b0951f2e + languageName: node + linkType: hard + "global-directory@npm:^4.0.1": version: 4.0.1 resolution: "global-directory@npm:4.0.1" @@ -7246,6 +7431,15 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:^2.5.1": + version: 2.5.2 + resolution: "jsesc@npm:2.5.2" + bin: + jsesc: bin/jsesc + checksum: 10c0/dbf59312e0ebf2b4405ef413ec2b25abb5f8f4d9bc5fb8d9f90381622ebca5f2af6a6aa9a8578f65903f9e33990a6dc798edd0ce5586894bf0e9e31803a1de88 + languageName: node + linkType: hard + "jsesc@npm:^3.0.2, jsesc@npm:~3.0.2": version: 3.0.2 resolution: "jsesc@npm:3.0.2" @@ -7948,6 +8142,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^8.0.2": + version: 8.0.4 + resolution: "minimatch@npm:8.0.4" + dependencies: + brace-expansion: "npm:^2.0.1" + checksum: 10c0/a0a394c356dd5b4cb7f821720841a82fa6f07c9c562c5b716909d1b6ec5e56a7e4c4b5029da26dd256b7d2b3a3f38cbf9ddd8680e887b9b5282b09c05501c1ca + languageName: node + linkType: hard + "minimatch@npm:^9.0.4": version: 9.0.5 resolution: "minimatch@npm:9.0.5" @@ -8024,6 +8227,13 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^4.2.4": + version: 4.2.8 + resolution: "minipass@npm:4.2.8" + checksum: 10c0/4ea76b030d97079f4429d6e8a8affd90baf1b6a1898977c8ccce4701c5a2ba2792e033abc6709373f25c2c4d4d95440d9d5e9464b46b7b76ca44d2ce26d939ce + languageName: node + linkType: hard + "minipass@npm:^5.0.0": version: 5.0.0 resolution: "minipass@npm:5.0.0" @@ -8708,7 +8918,7 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^1.11.1": +"path-scurry@npm:^1.11.1, path-scurry@npm:^1.6.1": version: 1.11.1 resolution: "path-scurry@npm:1.11.1" dependencies: @@ -8771,6 +8981,15 @@ __metadata: languageName: node linkType: hard +"pkg-up@npm:^3.1.0": + version: 3.1.0 + resolution: "pkg-up@npm:3.1.0" + dependencies: + find-up: "npm:^3.0.0" + checksum: 10c0/ecb60e1f8e1f611c0bdf1a0b6a474d6dfb51185567dc6f29cdef37c8d480ecba5362e006606bb290519bbb6f49526c403fabea93c3090c20368d98bb90c999ab + languageName: node + linkType: hard + "possible-typed-array-names@npm:^1.0.0": version: 1.0.0 resolution: "possible-typed-array-names@npm:1.0.0" @@ -9347,6 +9566,13 @@ __metadata: languageName: node linkType: hard +"reselect@npm:^4.1.7": + version: 4.1.8 + resolution: "reselect@npm:4.1.8" + checksum: 10c0/06a305a504affcbb67dd0561ddc8306b35796199c7e15b38934c80606938a021eadcf68cfd58e7bb5e17786601c37602a3362a4665c7bf0a96c1041ceee9d0b7 + languageName: node + linkType: hard + "resolve-cwd@npm:^3.0.0": version: 3.0.0 resolution: "resolve-cwd@npm:3.0.0" @@ -9384,7 +9610,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.1.6, resolve@npm:^1.14.2, resolve@npm:^1.20.0, resolve@npm:^1.22.4": +"resolve@npm:^1.1.6, resolve@npm:^1.14.2, resolve@npm:^1.20.0, resolve@npm:^1.22.4, resolve@npm:^1.22.8": version: 1.22.8 resolution: "resolve@npm:1.22.8" dependencies: @@ -9410,7 +9636,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@npm%3A^1.1.6#optional!builtin, resolve@patch:resolve@npm%3A^1.14.2#optional!builtin, resolve@patch:resolve@npm%3A^1.20.0#optional!builtin, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin": +"resolve@patch:resolve@npm%3A^1.1.6#optional!builtin, resolve@patch:resolve@npm%3A^1.14.2#optional!builtin, resolve@patch:resolve@npm%3A^1.20.0#optional!builtin, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin, resolve@patch:resolve@npm%3A^1.22.8#optional!builtin": version: 1.22.8 resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d" dependencies: @@ -10307,6 +10533,13 @@ __metadata: languageName: node linkType: hard +"to-fast-properties@npm:^2.0.0": + version: 2.0.0 + resolution: "to-fast-properties@npm:2.0.0" + checksum: 10c0/b214d21dbfb4bce3452b6244b336806ffea9c05297148d32ebb428d5c43ce7545bdfc65a1ceb58c9ef4376a65c0cb2854d645f33961658b3e3b4f84910ddcdd7 + languageName: node + linkType: hard + "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1"