Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit 250fd08

Browse files
committed
Configure linting and formatting
1 parent 4f3578b commit 250fd08

File tree

4 files changed

+132
-8
lines changed

4 files changed

+132
-8
lines changed

.eslintrc.js

+31-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
4-
};
3+
extends: ['@react-native-community'],
4+
plugins: [
5+
'import',
6+
'detox',
7+
8+
],
9+
10+
rules: {
11+
'import/order': ['warn', {alphabetize: {order: 'asc'}}], // group and then alphabetize lines - https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
12+
'no-duplicate-imports': 'error',
13+
quotes: ['error', 'single', {avoidEscape: true}], // single quote unless using interpolation
14+
'react/jsx-uses-react': 'off',
15+
'react/no-unstable-nested-components': ['warn', {allowAsProps: true}], // allow function props that return components
16+
'react/react-in-jsx-scope': 'off',
17+
'sort-imports': [
18+
'warn',
19+
{ignoreDeclarationSort: true, ignoreMemberSort: false},
20+
], // alphabetize named imports - https://eslint.org/docs/rules/sort-imports
21+
},
22+
overrides: [
23+
{
24+
files: ['e2e/**/*.test.js'],
25+
env: {
26+
'detox/detox': true,
27+
jest: true,
28+
'jest/globals': true,
29+
},
30+
},
31+
32+
],
33+
};

.prettierrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ module.exports = {
44
bracketSpacing: false,
55
singleQuote: true,
66
trailingComma: 'all',
7-
};
7+
};

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"babel-jest": "^29.2.1",
2626
"detox": "^20.5.0",
2727
"eslint": "^8.19.0",
28+
"eslint-plugin-detox": "^1.0.0",
29+
"eslint-plugin-import": "^2.27.5",
2830
"jest": "^29.2.1",
2931
"metro-react-native-babel-preset": "0.73.8",
3032
"prettier": "^2.4.1",
@@ -37,4 +39,4 @@
3739
"e2e"
3840
]
3941
}
40-
}
42+
}

yarn.lock

+97-4
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,11 @@
17671767
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3"
17681768
integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==
17691769

1770+
"@types/json5@^0.0.29":
1771+
version "0.0.29"
1772+
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
1773+
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
1774+
17701775
"@types/node@*":
17711776
version "18.15.5"
17721777
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.5.tgz#3af577099a99c61479149b716183e70b5239324a"
@@ -2092,6 +2097,16 @@ array-unique@^0.3.2:
20922097
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
20932098
integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==
20942099

2100+
array.prototype.flat@^1.3.1:
2101+
version "1.3.1"
2102+
resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz#ffc6576a7ca3efc2f46a143b9d1dda9b4b3cf5e2"
2103+
integrity sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==
2104+
dependencies:
2105+
call-bind "^1.0.2"
2106+
define-properties "^1.1.4"
2107+
es-abstract "^1.20.4"
2108+
es-shim-unscopables "^1.0.0"
2109+
20952110
array.prototype.flatmap@^1.3.1:
20962111
version "1.3.1"
20972112
resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183"
@@ -2784,6 +2799,13 @@ [email protected], debug@^2.2.0, debug@^2.3.3:
27842799
dependencies:
27852800
ms "2.0.0"
27862801

2802+
debug@^3.2.7:
2803+
version "3.2.7"
2804+
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
2805+
integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
2806+
dependencies:
2807+
ms "^2.1.1"
2808+
27872809
debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4:
27882810
version "4.3.4"
27892811
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
@@ -3131,6 +3153,29 @@ eslint-config-prettier@^8.5.0:
31313153
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348"
31323154
integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==
31333155

3156+
eslint-import-resolver-node@^0.3.7:
3157+
version "0.3.7"
3158+
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7"
3159+
integrity sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==
3160+
dependencies:
3161+
debug "^3.2.7"
3162+
is-core-module "^2.11.0"
3163+
resolve "^1.22.1"
3164+
3165+
eslint-module-utils@^2.7.4:
3166+
version "2.7.4"
3167+
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz#4f3e41116aaf13a20792261e61d3a2e7e0583974"
3168+
integrity sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==
3169+
dependencies:
3170+
debug "^3.2.7"
3171+
3172+
eslint-plugin-detox@^1.0.0:
3173+
version "1.0.0"
3174+
resolved "https://registry.yarnpkg.com/eslint-plugin-detox/-/eslint-plugin-detox-1.0.0.tgz#2d9c0130e8ebc4ced56efb6eeaf0d0f5c163398d"
3175+
integrity sha512-Dd+Cwyap5IO9DBKXOKrQTE1RQk9hvSSi+qsS1cMVPZY37mojz2PvriEOfGhKj5XN1G14lJ8TArf+6Y+Np2ZsoQ==
3176+
dependencies:
3177+
requireindex "~1.1.0"
3178+
31343179
eslint-plugin-eslint-comments@^3.2.0:
31353180
version "3.2.0"
31363181
resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz#9e1cd7b4413526abb313933071d7aba05ca12ffa"
@@ -3147,6 +3192,27 @@ eslint-plugin-ft-flow@^2.0.1:
31473192
lodash "^4.17.21"
31483193
string-natural-compare "^3.0.1"
31493194

3195+
eslint-plugin-import@^2.27.5:
3196+
version "2.27.5"
3197+
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz#876a6d03f52608a3e5bb439c2550588e51dd6c65"
3198+
integrity sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==
3199+
dependencies:
3200+
array-includes "^3.1.6"
3201+
array.prototype.flat "^1.3.1"
3202+
array.prototype.flatmap "^1.3.1"
3203+
debug "^3.2.7"
3204+
doctrine "^2.1.0"
3205+
eslint-import-resolver-node "^0.3.7"
3206+
eslint-module-utils "^2.7.4"
3207+
has "^1.0.3"
3208+
is-core-module "^2.11.0"
3209+
is-glob "^4.0.3"
3210+
minimatch "^3.1.2"
3211+
object.values "^1.1.6"
3212+
resolve "^1.22.1"
3213+
semver "^6.3.0"
3214+
tsconfig-paths "^3.14.1"
3215+
31503216
eslint-plugin-jest@^26.5.3:
31513217
version "26.9.0"
31523218
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.9.0.tgz#7931c31000b1c19e57dbfb71bbf71b817d1bf949"
@@ -4040,7 +4106,7 @@ is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7:
40404106
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055"
40414107
integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==
40424108

4043-
is-core-module@^2.9.0:
4109+
is-core-module@^2.11.0, is-core-module@^2.9.0:
40444110
version "2.11.0"
40454111
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144"
40464112
integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==
@@ -4842,6 +4908,13 @@ json-stable-stringify-without-jsonify@^1.0.1:
48424908
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
48434909
integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==
48444910

4911+
json5@^1.0.2:
4912+
version "1.0.2"
4913+
resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593"
4914+
integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==
4915+
dependencies:
4916+
minimist "^1.2.0"
4917+
48454918
json5@^2.2.2:
48464919
version "2.2.3"
48474920
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
@@ -5391,7 +5464,7 @@ minimatch@^5.0.1:
53915464
dependencies:
53925465
brace-expansion "^2.0.1"
53935466

5394-
minimist@^1.2.6:
5467+
minimist@^1.2.0, minimist@^1.2.6:
53955468
version "1.2.8"
53965469
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
53975470
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
@@ -5426,7 +5499,7 @@ [email protected]:
54265499
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
54275500
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
54285501

5429-
5502+
[email protected], ms@^2.1.1:
54305503
version "2.1.3"
54315504
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
54325505
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
@@ -6232,6 +6305,11 @@ require-main-filename@^2.0.0:
62326305
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
62336306
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
62346307

6308+
requireindex@~1.1.0:
6309+
version "1.1.0"
6310+
resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.1.0.tgz#e5404b81557ef75db6e49c5a72004893fe03e162"
6311+
integrity sha512-LBnkqsDE7BZKvqylbmn7lTIVdpx4K/QCduRATpO5R+wtPmky/a8pN1bO2D6wXppn1497AJF9mNjqAXr6bdl9jg==
6312+
62356313
resolve-cwd@^3.0.0:
62366314
version "3.0.0"
62376315
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d"
@@ -6264,7 +6342,7 @@ resolve.exports@^2.0.0:
62646342
resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.1.tgz#cee884cd4e3f355660e501fa3276b27d7ffe5a20"
62656343
integrity sha512-OEJWVeimw8mgQuj3HfkNl4KqRevH7lzeQNaWRPfx0PPse7Jk6ozcsG4FKVgtzDsC1KUF+YlTHh17NcgHOPykLw==
62666344

6267-
resolve@^1.14.2, resolve@^1.20.0:
6345+
resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1:
62686346
version "1.22.1"
62696347
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177"
62706348
integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==
@@ -6759,6 +6837,11 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1:
67596837
dependencies:
67606838
ansi-regex "^5.0.1"
67616839

6840+
strip-bom@^3.0.0:
6841+
version "3.0.0"
6842+
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
6843+
integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==
6844+
67626845
strip-bom@^4.0.0:
67636846
version "4.0.0"
67646847
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878"
@@ -6954,6 +7037,16 @@ truncate-utf8-bytes@^1.0.0:
69547037
dependencies:
69557038
utf8-byte-length "^1.0.1"
69567039

7040+
tsconfig-paths@^3.14.1:
7041+
version "3.14.2"
7042+
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088"
7043+
integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==
7044+
dependencies:
7045+
"@types/json5" "^0.0.29"
7046+
json5 "^1.0.2"
7047+
minimist "^1.2.6"
7048+
strip-bom "^3.0.0"
7049+
69577050
tslib@^1.8.1:
69587051
version "1.14.1"
69597052
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"

0 commit comments

Comments
 (0)