From 3fdb82a99a1b4bc94391978849fdcf571d122493 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Thu, 18 Jan 2024 22:09:15 +1030 Subject: [PATCH 1/3] chore(eslint): add `typescript-eslint` and `eslint-prettier` --- .eslintrc.cjs | 21 +++++ .eslintrc.json | 3 - package.json | 4 + pnpm-lock.yaml | 238 ++++++++++++++++++++++++++++++++++++++++++------- 4 files changed, 231 insertions(+), 35 deletions(-) create mode 100644 .eslintrc.cjs delete mode 100644 .eslintrc.json diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 00000000..0f9ee375 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,21 @@ +module.exports = { + parser: '@typescript-eslint/parser', + parserOptions: { + project: ['./tsconfig.json'], + }, + plugins: ['@typescript-eslint'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', + 'next/core-web-vitals', + ], + ignorePatterns: ['*.cjs'], + rules: { + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true }], + '@typescript-eslint/consistent-type-imports': 'warn', + }, +}; diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index bffb357a..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "next/core-web-vitals" -} diff --git a/package.json b/package.json index 5d69f179..b4257eb0 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,14 @@ "@types/node": "^20.11.0", "@types/react": "^18.2.47", "@types/react-dom": "^18.2.18", + "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/parser": "^6.19.0", "autoprefixer": "^10.4.16", "cross-env": "^7.0.3", "eslint": "^8.56.0", "eslint-config-next": "14.0.3", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.1.3", "lint-staged": "^15.2.0", "postcss": "^8.4.33", "prettier-plugin-jsdoc": "^1.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8c7166a6..94388b90 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,6 +49,12 @@ devDependencies: '@types/react-dom': specifier: ^18.2.18 version: 18.2.18 + '@typescript-eslint/eslint-plugin': + specifier: ^6.19.0 + version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': + specifier: ^6.19.0 + version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) autoprefixer: specifier: ^10.4.16 version: 10.4.16(postcss@8.4.33) @@ -61,6 +67,12 @@ devDependencies: eslint-config-next: specifier: 14.0.3 version: 14.0.3(eslint@8.56.0)(typescript@5.3.3) + eslint-config-prettier: + specifier: ^9.1.0 + version: 9.1.0(eslint@8.56.0) + eslint-plugin-prettier: + specifier: ^5.1.3 + version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.2.1) lint-staged: specifier: ^15.2.0 version: 15.2.0 @@ -782,6 +794,14 @@ packages: dev: true optional: true + /@pkgr/core@0.1.1: + resolution: + { + integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==, + } + engines: { node: ^12.20.0 || ^14.18.0 || >=16.0.0 } + dev: true + /@protobufjs/aspromise@1.1.2: resolution: { @@ -988,6 +1008,13 @@ packages: } dev: false + /@types/json-schema@7.0.15: + resolution: + { + integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==, + } + dev: true + /@types/json5@0.0.29: resolution: { @@ -1116,6 +1143,13 @@ packages: integrity: sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==, } + /@types/semver@7.5.6: + resolution: + { + integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==, + } + dev: true + /@types/send@0.17.4: resolution: { @@ -1144,10 +1178,42 @@ packages: } dev: true - /@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.3.3): + /@typescript-eslint/eslint-plugin@6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3): + resolution: + { + integrity: sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + peerDependencies: + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.10.0 + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.19.0 + '@typescript-eslint/type-utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.0 + debug: 4.3.4 + eslint: 8.56.0 + graphemer: 1.4.0 + ignore: 5.3.0 + natural-compare: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/parser@6.19.0(eslint@8.56.0)(typescript@5.3.3): resolution: { - integrity: sha512-zct/MdJnVaRRNy9e84XnVtRv9Vf91/qqe+hZJtKanjojud4wAVy/7lXxJmMyX6X6J+xc6c//YEWvpeif8cAhWA==, + integrity: sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==, } engines: { node: ^16.0.0 || >=18.0.0 } peerDependencies: @@ -1157,10 +1223,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.18.1 - '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.18.1 + '@typescript-eslint/scope-manager': 6.19.0 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.0 debug: 4.3.4 eslint: 8.56.0 typescript: 5.3.3 @@ -1168,29 +1234,52 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@6.18.1: + /@typescript-eslint/scope-manager@6.19.0: resolution: { - integrity: sha512-BgdBwXPFmZzaZUuw6wKiHKIovms97a7eTImjkXCZE04TGHysG+0hDQPmygyvgtkoB/aOQwSM/nWv3LzrOIQOBw==, + integrity: sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==, } engines: { node: ^16.0.0 || >=18.0.0 } dependencies: - '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/visitor-keys': 6.18.1 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/visitor-keys': 6.19.0 + dev: true + + /@typescript-eslint/type-utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): + resolution: + { + integrity: sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + debug: 4.3.4 + eslint: 8.56.0 + ts-api-utils: 1.0.3(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color dev: true - /@typescript-eslint/types@6.18.1: + /@typescript-eslint/types@6.19.0: resolution: { - integrity: sha512-4TuMAe+tc5oA7wwfqMtB0Y5OrREPF1GeJBAjqwgZh1lEMH5PJQgWgHGfYufVB51LtjD+peZylmeyxUXPfENLCw==, + integrity: sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==, } engines: { node: ^16.0.0 || >=18.0.0 } dev: true - /@typescript-eslint/typescript-estree@6.18.1(typescript@5.3.3): + /@typescript-eslint/typescript-estree@6.19.0(typescript@5.3.3): resolution: { - integrity: sha512-fv9B94UAhywPRhUeeV/v+3SBDvcPiLxRZJw/xZeeGgRLQZ6rLMG+8krrJUyIf6s1ecWTzlsbp0rlw7n9sjufHA==, + integrity: sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==, } engines: { node: ^16.0.0 || >=18.0.0 } peerDependencies: @@ -1199,8 +1288,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/visitor-keys': 6.18.1 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/visitor-keys': 6.19.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1212,14 +1301,36 @@ packages: - supports-color dev: true - /@typescript-eslint/visitor-keys@6.18.1: + /@typescript-eslint/utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): resolution: { - integrity: sha512-/kvt0C5lRqGoCfsbmm7/CwMqoSkY3zzHLIjdhHZQW3VFrnz7ATecOHR7nb7V+xn4286MBxfnQfQhAmCI0u+bJA==, + integrity: sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.6 + '@typescript-eslint/scope-manager': 6.19.0 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) + eslint: 8.56.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys@6.19.0: + resolution: + { + integrity: sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==, } engines: { node: ^16.0.0 || >=18.0.0 } dependencies: - '@typescript-eslint/types': 6.18.1 + '@typescript-eslint/types': 6.19.0 eslint-visitor-keys: 3.4.3 dev: true @@ -2467,11 +2578,11 @@ packages: dependencies: '@next/eslint-plugin-next': 14.0.3 '@rushstack/eslint-patch': 1.6.1 - '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.56.0) eslint-plugin-react: 7.33.2(eslint@8.56.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.56.0) @@ -2481,6 +2592,18 @@ packages: - supports-color dev: true + /eslint-config-prettier@9.1.0(eslint@8.56.0): + resolution: + { + integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==, + } + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: 8.56.0 + dev: true + /eslint-import-resolver-node@0.3.9: resolution: { @@ -2494,7 +2617,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0): resolution: { integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==, @@ -2507,8 +2630,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.15.0 eslint: 8.56.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) fast-glob: 3.3.2 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -2520,7 +2643,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): resolution: { integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==, @@ -2544,16 +2667,16 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) debug: 3.2.7 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.56.0) transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): resolution: { integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==, @@ -2566,7 +2689,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -2575,7 +2698,7 @@ packages: doctrine: 2.1.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -2619,6 +2742,30 @@ packages: object.fromentries: 2.0.7 dev: true + /eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.2.1): + resolution: + { + integrity: sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==, + } + engines: { node: ^14.18.0 || >=16.0.0 } + peerDependencies: + '@types/eslint': '>=8.0.0' + eslint: '>=8.0.0' + eslint-config-prettier: '*' + prettier: '>=3.0.0' + peerDependenciesMeta: + '@types/eslint': + optional: true + eslint-config-prettier: + optional: true + dependencies: + eslint: 8.56.0 + eslint-config-prettier: 9.1.0(eslint@8.56.0) + prettier: 3.2.1 + prettier-linter-helpers: 1.0.0 + synckit: 0.8.8 + dev: true + /eslint-plugin-react-hooks@4.6.0(eslint@8.56.0): resolution: { @@ -2822,6 +2969,13 @@ packages: } dev: true + /fast-diff@1.3.0: + resolution: + { + integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==, + } + dev: true + /fast-glob@3.3.2: resolution: { @@ -5108,6 +5262,16 @@ packages: engines: { node: '>= 0.8.0' } dev: true + /prettier-linter-helpers@1.0.0: + resolution: + { + integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==, + } + engines: { node: '>=6.0.0' } + dependencies: + fast-diff: 1.3.0 + dev: true + /prettier-plugin-jsdoc@1.3.0(prettier@3.2.1): resolution: { @@ -6058,6 +6222,17 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false + /synckit@0.8.8: + resolution: + { + integrity: sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==, + } + engines: { node: ^14.18.0 || >=16.0.0 } + dependencies: + '@pkgr/core': 0.1.1 + tslib: 2.6.2 + dev: true + /tailwindcss@3.4.1: resolution: { @@ -6255,7 +6430,6 @@ packages: { integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==, } - dev: false /tsutils@3.21.0(typescript@5.3.3): resolution: From 14b3337ecc58354a4264ad442cbc86c20bd1162d Mon Sep 17 00:00:00 2001 From: jsun969 Date: Thu, 18 Jan 2024 22:11:07 +1030 Subject: [PATCH 2/3] chore(eslint): warn `any` instead of error --- .eslintrc.cjs | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0f9ee375..7d4aca14 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -17,5 +17,6 @@ module.exports = { '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true }], '@typescript-eslint/consistent-type-imports': 'warn', + '@typescript-eslint/no-explicit-any': 'warn', }, }; From 4984218114c93aa78865747fca6d96d8c9ce6104 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Thu, 18 Jan 2024 22:12:50 +1030 Subject: [PATCH 3/3] chore: lint files --- src/app/(account)/helpers.ts | 2 +- src/app/(account)/join-us/steps/StepThree.tsx | 2 +- src/app/(account)/join-us/store.ts | 4 ++-- src/app/layout.tsx | 2 +- src/components/ControlledField.tsx | 6 ++++-- src/components/Field.tsx | 3 ++- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/app/(account)/helpers.ts b/src/app/(account)/helpers.ts index 2f04d68e..dbcbb164 100644 --- a/src/app/(account)/helpers.ts +++ b/src/app/(account)/helpers.ts @@ -1,4 +1,4 @@ -import { FieldPath, FieldValues, UseFormReturn } from 'react-hook-form'; +import type { FieldPath, FieldValues, UseFormReturn } from 'react-hook-form'; /** * Show clerk error message in form. diff --git a/src/app/(account)/join-us/steps/StepThree.tsx b/src/app/(account)/join-us/steps/StepThree.tsx index 569dd3c5..8b58e2dc 100644 --- a/src/app/(account)/join-us/steps/StepThree.tsx +++ b/src/app/(account)/join-us/steps/StepThree.tsx @@ -4,7 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; import { useJoinUsStep, useJoinUsStudentInfo, useSetJoinUsHeading } from '../store'; -import { STUDENT_STATUSES } from './StepTwo'; +import type { STUDENT_STATUSES } from './StepTwo'; const DEGREES = [ 'Bachelor of Computer Science or Bachelor of Computer Science (Advanced)', diff --git a/src/app/(account)/join-us/store.ts b/src/app/(account)/join-us/store.ts index f2b9d708..f4d07910 100644 --- a/src/app/(account)/join-us/store.ts +++ b/src/app/(account)/join-us/store.ts @@ -1,7 +1,7 @@ import { useMount } from '@/hooks/use-mount'; import { create } from 'zustand'; -import { StepThreeData } from './steps/StepThree'; -import { StepTwoData } from './steps/StepTwo'; +import type { StepThreeData } from './steps/StepThree'; +import type { StepTwoData } from './steps/StepTwo'; // Step type JoinUsStepState = { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index b1980ea6..c4faa335 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,5 +1,5 @@ import '@/styles/globals.css'; -import { ClerkProvider, SignedIn, SignedOut, RedirectToSignIn } from '@clerk/nextjs'; +import { ClerkProvider } from '@clerk/nextjs'; import type { Metadata, Viewport } from 'next'; import { Archivo } from 'next/font/google'; diff --git a/src/components/ControlledField.tsx b/src/components/ControlledField.tsx index 62c87ff8..20c84dad 100644 --- a/src/components/ControlledField.tsx +++ b/src/components/ControlledField.tsx @@ -1,5 +1,7 @@ -import { Control, FieldPath, FieldValues, useController } from 'react-hook-form'; -import Field, { FieldProps } from './Field'; +import type { Control, FieldPath, FieldValues } from 'react-hook-form'; +import { useController } from 'react-hook-form'; +import type { FieldProps } from './Field'; +import Field from './Field'; interface ControlledFieldProps extends Omit { diff --git a/src/components/Field.tsx b/src/components/Field.tsx index 44d6d83b..1afb4e3c 100644 --- a/src/components/Field.tsx +++ b/src/components/Field.tsx @@ -1,4 +1,5 @@ -import { ChangeEvent, useState } from 'react'; +import type { ChangeEvent } from 'react'; +import { useState } from 'react'; import { IoEye, IoEyeOff } from 'react-icons/io5'; export interface FieldProps {