Skip to content

Commit a2e471c

Browse files
committed
Adds preliminary eslint config.
1 parent 6d9b2e3 commit a2e471c

File tree

6 files changed

+126
-5
lines changed

6 files changed

+126
-5
lines changed

.eslintrc.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native',
4-
};
3+
extends: [
4+
"@react-native",
5+
'plugin:prettier/recommended', // must be last
6+
],
7+
parser: '@typescript-eslint/parser',
8+
parserOptions: {
9+
ecmaVersion: 'latest',
10+
sourceType: 'module',
11+
project: ['./tsconfig.json', './tsconfig.tools.json'],
12+
},
13+
plugins: [],
14+
rules: {
15+
'prettier/prettier': ['error'],
16+
},
17+
}

.prettierrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ module.exports = {
44
bracketSpacing: false,
55
singleQuote: true,
66
trailingComma: 'all',
7+
semi: false,
8+
plugins: ['prettier-plugin-packagejson'],
79
}

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// List of extensions which should be recommended for users of this workspace.
3+
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
4+
5+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
6+
"unwantedRecommendations": []
7+
}

.vscode/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"editor.formatOnSave": false,
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll.eslint": "explicit"
5+
},
6+
"[json]": {
7+
"editor.defaultFormatter": "esbenp.prettier-vscode",
8+
"editor.formatOnSave": true
9+
},
10+
"[jsonc]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode",
12+
"editor.formatOnSave": true
13+
},
14+
"[markdown]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode",
16+
"editor.formatOnSave": true
17+
}
18+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"android": "react-native run-android",
77
"ios": "react-native run-ios",
8-
"lint": "eslint .",
8+
"lint": "eslint . --fix --ext .js,.ts,.tsx,.cjs,.mjs --cache",
99
"start": "react-native start",
1010
"test": "jest",
1111
"setup": "./scripts/setup/index",
@@ -35,6 +35,7 @@
3535
"@types/react": "^18.2.46",
3636
"@types/react-test-renderer": "^18.0.7",
3737
"babel-jest": "^29.7.0",
38+
"prettier-plugin-packagejson": "^2.4.8",
3839
"eslint": "^8.56.0",
3940
"jest": "^29.7.0",
4041
"prettier": "3.1.1",

yarn.lock

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,6 +1978,11 @@
19781978
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
19791979
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
19801980

1981+
"@pkgr/core@^0.1.0":
1982+
version "0.1.0"
1983+
resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.0.tgz#7d8dacb7fdef0e4387caf7396cbd77f179867d06"
1984+
integrity sha512-Zwq5OCzuwJC2jwqmpEQt7Ds1DTi6BWSwoGkbb1n9pO3hzb35BoJELx7c0T23iDkBGkh2e7tvOtjF3tr3OaQHDQ==
1985+
19811986
"@react-native-community/[email protected]":
19821987
version "12.3.0"
19831988
resolved "https://registry.yarnpkg.com/@react-native-community/cli-clean/-/cli-clean-12.3.0.tgz#667b32daa58b4d11d5b5ab9eb0a2e216d500c90b"
@@ -4007,6 +4012,11 @@ [email protected]:
40074012
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015"
40084013
integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==
40094014

4015+
detect-indent@^7.0.1:
4016+
version "7.0.1"
4017+
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-7.0.1.tgz#cbb060a12842b9c4d333f1cac4aa4da1bb66bc25"
4018+
integrity sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==
4019+
40104020
detect-libc@^1.0.3:
40114021
version "1.0.3"
40124022
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
@@ -4017,6 +4027,11 @@ detect-newline@^3.0.0:
40174027
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"
40184028
integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==
40194029

4030+
detect-newline@^4.0.0:
4031+
version "4.0.1"
4032+
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-4.0.1.tgz#fcefdb5713e1fb8cb2839b8b6ee22e6716ab8f23"
4033+
integrity sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==
4034+
40204035
diff-sequences@^29.6.3:
40214036
version "29.6.3"
40224037
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921"
@@ -4587,7 +4602,7 @@ fast-diff@^1.1.2:
45874602
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0"
45884603
integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==
45894604

4590-
fast-glob@^3.2.5, fast-glob@^3.2.9:
4605+
fast-glob@^3.2.5, fast-glob@^3.2.9, fast-glob@^3.3.0:
45914606
version "3.3.2"
45924607
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129"
45934608
integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==
@@ -4908,6 +4923,11 @@ get-port@^3.2.0:
49084923
resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc"
49094924
integrity sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==
49104925

4926+
get-stdin@^9.0.0:
4927+
version "9.0.0"
4928+
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-9.0.0.tgz#3983ff82e03d56f1b2ea0d3e60325f39d703a575"
4929+
integrity sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==
4930+
49114931
get-stream@^4.0.0:
49124932
version "4.1.0"
49134933
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
@@ -4933,6 +4953,11 @@ getenv@^1.0.0:
49334953
resolved "https://registry.yarnpkg.com/getenv/-/getenv-1.0.0.tgz#874f2e7544fbca53c7a4738f37de8605c3fcfc31"
49344954
integrity sha512-7yetJWqbS9sbn0vIfliPsFgoXMKn/YMF+Wuiog97x+urnSRRRZ7xB+uVkwGKzRgq9CDFfMQnE9ruL5DHv9c6Xg==
49354955

4956+
git-hooks-list@^3.0.0:
4957+
version "3.1.0"
4958+
resolved "https://registry.yarnpkg.com/git-hooks-list/-/git-hooks-list-3.1.0.tgz#386dc531dcc17474cf094743ff30987a3d3e70fc"
4959+
integrity sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==
4960+
49364961
glob-parent@^5.1.2:
49374962
version "5.1.2"
49384963
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
@@ -5024,6 +5049,17 @@ globby@^11.0.1, globby@^11.1.0:
50245049
merge2 "^1.4.1"
50255050
slash "^3.0.0"
50265051

5052+
globby@^13.1.2:
5053+
version "13.2.2"
5054+
resolved "https://registry.yarnpkg.com/globby/-/globby-13.2.2.tgz#63b90b1bf68619c2135475cbd4e71e66aa090592"
5055+
integrity sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==
5056+
dependencies:
5057+
dir-glob "^3.0.1"
5058+
fast-glob "^3.3.0"
5059+
ignore "^5.2.4"
5060+
merge2 "^1.4.1"
5061+
slash "^4.0.0"
5062+
50275063
gopd@^1.0.1:
50285064
version "1.0.1"
50295065
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c"
@@ -5462,6 +5498,11 @@ is-path-inside@^3.0.2, is-path-inside@^3.0.3:
54625498
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
54635499
integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==
54645500

5501+
is-plain-obj@^4.1.0:
5502+
version "4.1.0"
5503+
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-4.1.0.tgz#d65025edec3657ce032fd7db63c97883eaed71f0"
5504+
integrity sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==
5505+
54655506
is-plain-object@^2.0.4:
54665507
version "2.0.4"
54675508
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
@@ -7335,6 +7376,14 @@ prettier-linter-helpers@^1.0.0:
73357376
dependencies:
73367377
fast-diff "^1.1.2"
73377378

7379+
prettier-plugin-packagejson@^2.4.8:
7380+
version "2.4.9"
7381+
resolved "https://registry.yarnpkg.com/prettier-plugin-packagejson/-/prettier-plugin-packagejson-2.4.9.tgz#17e4aa6539f7d73490c4ff8f213a7b2e4e3f8a2a"
7382+
integrity sha512-b3Q7agXVqxK3UpYEJr0xLD51SxriYXESWUCjmxOBUGqnPFZOg9jZGZ+Ptzq252I6OqzXN2rj1tJIFq6KOGLLJw==
7383+
dependencies:
7384+
sort-package-json "2.6.0"
7385+
synckit "0.9.0"
7386+
73387387
73397388
version "3.1.1"
73407389
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848"
@@ -8112,6 +8161,11 @@ slash@^3.0.0:
81128161
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
81138162
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
81148163

8164+
slash@^4.0.0:
8165+
version "4.0.0"
8166+
resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7"
8167+
integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==
8168+
81158169
slice-ansi@^2.0.0:
81168170
version "2.1.0"
81178171
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636"
@@ -8134,6 +8188,24 @@ snake-case@^3.0.4:
81348188
dot-case "^3.0.4"
81358189
tslib "^2.0.3"
81368190

8191+
sort-object-keys@^1.1.3:
8192+
version "1.1.3"
8193+
resolved "https://registry.yarnpkg.com/sort-object-keys/-/sort-object-keys-1.1.3.tgz#bff833fe85cab147b34742e45863453c1e190b45"
8194+
integrity sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==
8195+
8196+
8197+
version "2.6.0"
8198+
resolved "https://registry.yarnpkg.com/sort-package-json/-/sort-package-json-2.6.0.tgz#68337dbbd267971add856308a9b454a7d6cbfc0a"
8199+
integrity sha512-XSQ+lY9bAYA8ZsoChcEoPlgcSMaheziEp1beox1JVxy1SV4F2jSq9+h2rJ+3mC/Dhu9Ius1DLnInD5AWcsDXZw==
8200+
dependencies:
8201+
detect-indent "^7.0.1"
8202+
detect-newline "^4.0.0"
8203+
get-stdin "^9.0.0"
8204+
git-hooks-list "^3.0.0"
8205+
globby "^13.1.2"
8206+
is-plain-obj "^4.1.0"
8207+
sort-object-keys "^1.1.3"
8208+
81378209
source-map-js@^1.0.2:
81388210
version "1.0.2"
81398211
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
@@ -8458,6 +8530,14 @@ supports-preserve-symlinks-flag@^1.0.0:
84588530
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
84598531
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
84608532

8533+
8534+
version "0.9.0"
8535+
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.9.0.tgz#5b33b458b3775e4466a5b377fba69c63572ae449"
8536+
integrity sha512-7RnqIMq572L8PeEzKeBINYEJDDxpcH8JEgLwUqBd3TkofhFRbkq4QLR0u+36avGAhCRbk2nnmjcW9SE531hPDg==
8537+
dependencies:
8538+
"@pkgr/core" "^0.1.0"
8539+
tslib "^2.6.2"
8540+
84618541
tar@^6.0.2, tar@^6.0.5:
84628542
version "6.2.0"
84638543
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.0.tgz#b14ce49a79cb1cd23bc9b016302dea5474493f73"
@@ -8630,7 +8710,7 @@ tslib@^1.8.1:
86308710
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
86318711
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
86328712

8633-
tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.0:
8713+
tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.6.2:
86348714
version "2.6.2"
86358715
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
86368716
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==

0 commit comments

Comments
 (0)