chore: create ts path aliases and add ts-reset

This commit is contained in:
Nicolas Meienberger 2023-03-28 21:26:40 +02:00 committed by Nicolas Meienberger
parent d18d50814e
commit 2571d96e11
5 changed files with 199 additions and 71 deletions

View file

@ -1,5 +1,5 @@
module.exports = {
plugins: ['@typescript-eslint', 'import', 'react', 'jest', 'jsdoc'],
plugins: ['@typescript-eslint', 'import', 'react', 'jest', 'jsdoc', 'import'],
extends: [
'plugin:@typescript-eslint/recommended',
'next/core-web-vitals',
@ -29,9 +29,10 @@ module.exports = {
'react/jsx-props-no-spreading': 0,
'react/no-unused-prop-types': 0,
'react/button-has-type': 0,
'import/no-extraneous-dependencies': ['error', { devDependencies: ['esbuild.js', '**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}', '**/*.factory.{ts,tsx}', '**/mocks/**', 'tests/**'] }],
'import/no-extraneous-dependencies': ['error', { devDependencies: ['esbuild.js', '**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}', '**/*.factory.{ts,tsx}', '**/mocks/**', 'tests/**', '**/*.d.ts'] }],
'no-underscore-dangle': 0,
'arrow-body-style': 0,
'class-methods-use-this': 0,
},
globals: {
JSX: true,

View file

@ -31,6 +31,7 @@
"dependencies": {
"@hookform/resolvers": "^2.9.10",
"@prisma/client": "^4.11.0",
"@radix-ui/react-tabs": "^1.0.3",
"@runtipi/postgres-migrations": "^5.3.0",
"@tabler/core": "1.0.0-beta17",
"@tabler/icons-react": "^2.11.0",
@ -77,6 +78,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@total-typescript/ts-reset": "^0.4.2",
"@types/express": "^4.17.13",
"@types/fs-extra": "^11.0.1",
"@types/isomorphic-fetch": "^0.0.36",
@ -100,7 +102,8 @@
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-next": "13.2.4",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-import": "^2.25.3",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.1.7",
"eslint-plugin-jsdoc": "^40.1.0",
"eslint-plugin-jsx-a11y": "^6.6.1",

View file

@ -5,6 +5,7 @@ specifiers:
'@faker-js/faker': ^7.6.0
'@hookform/resolvers': ^2.9.10
'@prisma/client': ^4.11.0
'@radix-ui/react-tabs': ^1.0.3
'@runtipi/postgres-migrations': ^5.3.0
'@tabler/core': 1.0.0-beta17
'@tabler/icons-react': ^2.11.0
@ -14,6 +15,7 @@ specifiers:
'@testing-library/jest-dom': ^5.16.5
'@testing-library/react': ^14.0.0
'@testing-library/user-event': ^14.4.3
'@total-typescript/ts-reset': ^0.4.2
'@trpc/client': ^10.16.0
'@trpc/next': ^10.16.0
'@trpc/react-query': ^10.16.0
@ -43,7 +45,8 @@ specifiers:
eslint-config-airbnb-typescript: ^17.0.0
eslint-config-next: 13.2.4
eslint-config-prettier: ^8.7.0
eslint-plugin-import: ^2.25.3
eslint-import-resolver-typescript: ^3.5.3
eslint-plugin-import: ^2.27.5
eslint-plugin-jest: ^27.1.7
eslint-plugin-jsdoc: ^40.1.0
eslint-plugin-jsx-a11y: ^6.6.1
@ -92,6 +95,7 @@ specifiers:
dependencies:
'@hookform/resolvers': 2.9.11_react-hook-form@7.43.7
'@prisma/client': 4.11.0_prisma@4.11.0
'@radix-ui/react-tabs': 1.0.3_biqbaboplfbrettd7655fr4n2y
'@runtipi/postgres-migrations': 5.3.0
'@tabler/core': 1.0.0-beta17
'@tabler/icons-react': 2.11.0_react@18.2.0
@ -138,6 +142,7 @@ devDependencies:
'@testing-library/jest-dom': 5.16.5
'@testing-library/react': 14.0.0_biqbaboplfbrettd7655fr4n2y
'@testing-library/user-event': 14.4.3_@testing-library+dom@9.0.1
'@total-typescript/ts-reset': 0.4.2
'@types/express': 4.17.17
'@types/fs-extra': 11.0.1
'@types/isomorphic-fetch': 0.0.36
@ -161,7 +166,8 @@ devDependencies:
eslint-config-airbnb-typescript: 17.0.0_g4ufqspmwdmninnalnmypeb4gi
eslint-config-next: 13.2.4_j4766f7ecgqbon3u7zlxn5zszu
eslint-config-prettier: 8.7.0_eslint@8.36.0
eslint-plugin-import: 2.27.5_a7er6olmtneep4uytpot6gt7wu
eslint-import-resolver-typescript: 3.5.3_eakrjjutlgqjxe5ydhtnd4qdmy
eslint-plugin-import: 2.27.5_v7jo3sddp7aqau7pajjy572cju
eslint-plugin-jest: 27.2.1_ccrqb4jwxka5photvcep762rre
eslint-plugin-jsdoc: 40.1.0_eslint@8.36.0
eslint-plugin-jsx-a11y: 6.7.1_eslint@8.36.0
@ -1425,6 +1431,166 @@ packages:
resolution: {integrity: sha512-0AEBi2HXGV02cf6ASsBPhfsVIbVSDC9nbQed4iiY5eHttW9ZtMxHThuKZE1pnESbr8HRdgmFSa/Kn4OSNYuibg==}
requiresBuild: true
/@radix-ui/primitive/1.0.0:
resolution: {integrity: sha512-3e7rn8FDMin4CgeL7Z/49smCA3rFYY3Ha2rUQ7HRWFadS5iCRw08ZgVT1LaNTCNqgvrUiyczLflrVrF0SRQtNA==}
dependencies:
'@babel/runtime': 7.20.13
dev: false
/@radix-ui/react-collection/1.0.2_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-s8WdQQ6wNXpaxdZ308KSr8fEWGrg4un8i4r/w7fhiS4ElRNjk5rRcl0/C6TANG2LvLOGIxtzo/jAg6Qf73TEBw==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
'@radix-ui/react-compose-refs': 1.0.0_react@18.2.0
'@radix-ui/react-context': 1.0.0_react@18.2.0
'@radix-ui/react-primitive': 1.0.2_biqbaboplfbrettd7655fr4n2y
'@radix-ui/react-slot': 1.0.1_react@18.2.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
dev: false
/@radix-ui/react-compose-refs/1.0.0_react@18.2.0:
resolution: {integrity: sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
react: 18.2.0
dev: false
/@radix-ui/react-context/1.0.0_react@18.2.0:
resolution: {integrity: sha512-1pVM9RfOQ+n/N5PJK33kRSKsr1glNxomxONs5c49MliinBY6Yw2Q995qfBUUo0/Mbg05B/sGA0gkgPI7kmSHBg==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
react: 18.2.0
dev: false
/@radix-ui/react-direction/1.0.0_react@18.2.0:
resolution: {integrity: sha512-2HV05lGUgYcA6xgLQ4BKPDmtL+QbIZYH5fCOTAOOcJ5O0QbWS3i9lKaurLzliYUDhORI2Qr3pyjhJh44lKA3rQ==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
react: 18.2.0
dev: false
/@radix-ui/react-id/1.0.0_react@18.2.0:
resolution: {integrity: sha512-Q6iAB/U7Tq3NTolBBQbHTgclPmGWE3OlktGGqrClPozSw4vkQ1DfQAOtzgRPecKsMdJINE05iaoDUG8tRzCBjw==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
'@radix-ui/react-use-layout-effect': 1.0.0_react@18.2.0
react: 18.2.0
dev: false
/@radix-ui/react-presence/1.0.0_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-A+6XEvN01NfVWiKu38ybawfHsBjWum42MRPnEuqPsBZ4eV7e/7K321B5VgYMPv3Xx5An6o1/l9ZuDBgmcmWK3w==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
'@radix-ui/react-compose-refs': 1.0.0_react@18.2.0
'@radix-ui/react-use-layout-effect': 1.0.0_react@18.2.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
dev: false
/@radix-ui/react-primitive/1.0.2_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-zY6G5Qq4R8diFPNwtyoLRZBxzu1Z+SXMlfYpChN7Dv8gvmx9X3qhDqiLWvKseKVJMuedFeU/Sa0Sy/Ia+t06Dw==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
'@radix-ui/react-slot': 1.0.1_react@18.2.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
dev: false
/@radix-ui/react-roving-focus/1.0.3_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-stjCkIoMe6h+1fWtXlA6cRfikdBzCLp3SnVk7c48cv/uy3DTGoXhN76YaOYUJuy3aEDvDIKwKR5KSmvrtPvQPQ==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
'@radix-ui/primitive': 1.0.0
'@radix-ui/react-collection': 1.0.2_biqbaboplfbrettd7655fr4n2y
'@radix-ui/react-compose-refs': 1.0.0_react@18.2.0
'@radix-ui/react-context': 1.0.0_react@18.2.0
'@radix-ui/react-direction': 1.0.0_react@18.2.0
'@radix-ui/react-id': 1.0.0_react@18.2.0
'@radix-ui/react-primitive': 1.0.2_biqbaboplfbrettd7655fr4n2y
'@radix-ui/react-use-callback-ref': 1.0.0_react@18.2.0
'@radix-ui/react-use-controllable-state': 1.0.0_react@18.2.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
dev: false
/@radix-ui/react-slot/1.0.1_react@18.2.0:
resolution: {integrity: sha512-avutXAFL1ehGvAXtPquu0YK5oz6ctS474iM3vNGQIkswrVhdrS52e3uoMQBzZhNRAIE0jBnUyXWNmSjGHhCFcw==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
'@radix-ui/react-compose-refs': 1.0.0_react@18.2.0
react: 18.2.0
dev: false
/@radix-ui/react-tabs/1.0.3_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-4CkF/Rx1GcrusI/JZ1Rvyx4okGUs6wEenWA0RG/N+CwkRhTy7t54y7BLsWUXrAz/GRbBfHQg/Odfs/RoW0CiRA==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
'@radix-ui/primitive': 1.0.0
'@radix-ui/react-context': 1.0.0_react@18.2.0
'@radix-ui/react-direction': 1.0.0_react@18.2.0
'@radix-ui/react-id': 1.0.0_react@18.2.0
'@radix-ui/react-presence': 1.0.0_biqbaboplfbrettd7655fr4n2y
'@radix-ui/react-primitive': 1.0.2_biqbaboplfbrettd7655fr4n2y
'@radix-ui/react-roving-focus': 1.0.3_biqbaboplfbrettd7655fr4n2y
'@radix-ui/react-use-controllable-state': 1.0.0_react@18.2.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
dev: false
/@radix-ui/react-use-callback-ref/1.0.0_react@18.2.0:
resolution: {integrity: sha512-GZtyzoHz95Rhs6S63D2t/eqvdFCm7I+yHMLVQheKM7nBD8mbZIt+ct1jz4536MDnaOGKIxynJ8eHTkVGVVkoTg==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
react: 18.2.0
dev: false
/@radix-ui/react-use-controllable-state/1.0.0_react@18.2.0:
resolution: {integrity: sha512-FohDoZvk3mEXh9AWAVyRTYR4Sq7/gavuofglmiXB2g1aKyboUD4YtgWxKj8O5n+Uak52gXQ4wKz5IFST4vtJHg==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
'@radix-ui/react-use-callback-ref': 1.0.0_react@18.2.0
react: 18.2.0
dev: false
/@radix-ui/react-use-layout-effect/1.0.0_react@18.2.0:
resolution: {integrity: sha512-6Tpkq+R6LOlmQb1R5NNETLG0B4YP0wc+klfXafpUCj6JGyaUc8il7/kUZ7m59rGbXGczE9Bs+iz2qloqsZBduQ==}
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
dependencies:
'@babel/runtime': 7.20.13
react: 18.2.0
dev: false
/@redis/bloom/1.2.0_@redis+client@1.5.6:
resolution: {integrity: sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==}
peerDependencies:
@ -1680,6 +1846,10 @@ packages:
engines: {node: '>= 10'}
dev: true
/@total-typescript/ts-reset/0.4.2:
resolution: {integrity: sha512-vqd7ZUDSrXFVT1n8b2kc3LnklncDQFPvR58yUS1kEP23/nHPAO9l1lMjUfnPrXYYk4Hj54rrLKMW5ipwk7k09A==}
dev: true
/@trpc/client/10.16.0_@trpc+server@10.16.0:
resolution: {integrity: sha512-Hxxi3mOcUyszosj6xpPDIIBV1TOhXKpZ191BW/60r1lXBAfNrDUWHOTol1Dfu+hpcx4bpj3WRyob5cf+6KeCDA==}
peerDependencies:
@ -2589,7 +2759,7 @@ packages:
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
dependencies:
caniuse-lite: 1.0.30001456
caniuse-lite: 1.0.30001469
electron-to-chromium: 1.4.301
node-releases: 2.0.10
update-browserslist-db: 1.0.10_browserslist@4.21.5
@ -2654,6 +2824,9 @@ packages:
/caniuse-lite/1.0.30001456:
resolution: {integrity: sha512-XFHJY5dUgmpMV25UqaD4kVq2LsiaU5rS8fb0f17pCoXQiQslzmFgnfOxfvo1bTpTqf7dwG/N/05CnLCnOEKmzA==}
/caniuse-lite/1.0.30001469:
resolution: {integrity: sha512-Rcp7221ScNqQPP3W+lVOYDyjdR6dC+neEQCttoNr5bAyz54AboB4iwpnWgyi8P4YUsPybVzT4LgWiBbI3drL4g==}
/ccount/2.0.1:
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
dev: false
@ -3407,7 +3580,7 @@ packages:
dependencies:
confusing-browser-globals: 1.0.11
eslint: 8.36.0
eslint-plugin-import: 2.27.5_a7er6olmtneep4uytpot6gt7wu
eslint-plugin-import: 2.27.5_v7jo3sddp7aqau7pajjy572cju
object.assign: 4.1.4
object.entries: 1.1.6
semver: 6.3.0
@ -3425,7 +3598,7 @@ packages:
'@typescript-eslint/parser': 5.55.0_j4766f7ecgqbon3u7zlxn5zszu
eslint: 8.36.0
eslint-config-airbnb-base: 15.0.0_eakrjjutlgqjxe5ydhtnd4qdmy
eslint-plugin-import: 2.27.5_a7er6olmtneep4uytpot6gt7wu
eslint-plugin-import: 2.27.5_v7jo3sddp7aqau7pajjy572cju
dev: true
/eslint-config-airbnb/19.0.4_guhfqc3yvckhutqwrddiy54d5i:
@ -3440,7 +3613,7 @@ packages:
dependencies:
eslint: 8.36.0
eslint-config-airbnb-base: 15.0.0_eakrjjutlgqjxe5ydhtnd4qdmy
eslint-plugin-import: 2.27.5_a7er6olmtneep4uytpot6gt7wu
eslint-plugin-import: 2.27.5_v7jo3sddp7aqau7pajjy572cju
eslint-plugin-jsx-a11y: 6.7.1_eslint@8.36.0
eslint-plugin-react: 7.32.2_eslint@8.36.0
eslint-plugin-react-hooks: 4.6.0_eslint@8.36.0
@ -3512,35 +3685,6 @@ packages:
- supports-color
dev: true
/eslint-module-utils/2.7.4_tzfhnsp6rhftjfsbnqrkrbah74:
resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==}
engines: {node: '>=4'}
peerDependencies:
'@typescript-eslint/parser': '*'
eslint: '*'
eslint-import-resolver-node: '*'
eslint-import-resolver-typescript: '*'
eslint-import-resolver-webpack: '*'
peerDependenciesMeta:
'@typescript-eslint/parser':
optional: true
eslint:
optional: true
eslint-import-resolver-node:
optional: true
eslint-import-resolver-typescript:
optional: true
eslint-import-resolver-webpack:
optional: true
dependencies:
'@typescript-eslint/parser': 5.55.0_j4766f7ecgqbon3u7zlxn5zszu
debug: 3.2.7
eslint: 8.36.0
eslint-import-resolver-node: 0.3.7
transitivePeerDependencies:
- supports-color
dev: true
/eslint-module-utils/2.7.4_wgltsi2kbncdpzwytonvdf2oba:
resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==}
engines: {node: '>=4'}
@ -3571,39 +3715,6 @@ packages:
- supports-color
dev: true
/eslint-plugin-import/2.27.5_a7er6olmtneep4uytpot6gt7wu:
resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==}
engines: {node: '>=4'}
peerDependencies:
'@typescript-eslint/parser': '*'
eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8
peerDependenciesMeta:
'@typescript-eslint/parser':
optional: true
dependencies:
'@typescript-eslint/parser': 5.55.0_j4766f7ecgqbon3u7zlxn5zszu
array-includes: 3.1.6
array.prototype.flat: 1.3.1
array.prototype.flatmap: 1.3.1
debug: 3.2.7
doctrine: 2.1.0
eslint: 8.36.0
eslint-import-resolver-node: 0.3.7
eslint-module-utils: 2.7.4_tzfhnsp6rhftjfsbnqrkrbah74
has: 1.0.3
is-core-module: 2.11.0
is-glob: 4.0.3
minimatch: 3.1.2
object.values: 1.1.6
resolve: 1.22.1
semver: 6.3.0
tsconfig-paths: 3.14.1
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
dev: true
/eslint-plugin-import/2.27.5_v7jo3sddp7aqau7pajjy572cju:
resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==}
engines: {node: '>=4'}

1
reset.d.ts vendored Normal file
View file

@ -0,0 +1 @@
import '@total-typescript/ts-reset';

View file

@ -1,6 +1,18 @@
{
"compilerOptions": {
"target": "es2017",
"baseUrl": ".",
"paths": {
"@/components/*": [
"./src/client/components/*"
],
"@/utils/*": [
"./src/client/utils/*"
],
"@/client/*": [
"./src/client/*"
],
},
"lib": [
"dom",
"dom.iterable",