diff --git a/.eslintrc.js b/.eslintrc.js index 94b66c9b7..12f954b96 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,6 +5,7 @@ const ERROR = 2 /* eslint-enable @typescript-eslint/no-unused-vars */ module.exports = { + reportUnusedDisableDirectives: true, parser: "@typescript-eslint/parser", parserOptions: { ecmaVersion: 2020, @@ -42,5 +43,7 @@ module.exports = { // jsx-ally "jsx-a11y/no-onchange": WARN, "import/no-anonymous-default-export": OFF, + // next + "@next/next/no-img-element": OFF, }, } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da1ee7803..7b0e12aac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,11 +12,16 @@ env: HUSKY: 0 jobs: - ci: - name: CI + check: + name: Run ${{ matrix.script }} code check runs-on: ubuntu-latest timeout-minutes: 15 + strategy: + fail-fast: true + matrix: + script: [format, lint] + steps: - name: Checkout repo uses: actions/checkout@v4 @@ -34,6 +39,6 @@ jobs: shell: bash run: pnpm install --frozen-lockfile - - name: Format + - name: Run ${{ matrix.script }} run: | - pnpm run format + pnpm run ${{ matrix.script }} diff --git a/package.json b/package.json index 925ccbd74..805556920 100644 --- a/package.json +++ b/package.json @@ -34,11 +34,12 @@ }, "devDependencies": { "@next/bundle-analyzer": "^13.4.5", + "@types/react": "^18.3.11", "@types/react-helmet": "^6.1.6", - "@typescript-eslint/eslint-plugin": "^5.59.11", - "@typescript-eslint/parser": "^5.59.11", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "@typescript-eslint/parser": "^8.18.0", "cross-env": "^7.0.3", - "eslint": "^8.42.0", + "eslint": "^8.57.1", "eslint-config-next": "^13.4.5", "eslint-config-prettier": "^8.8.0", "eslint-plugin-jsx-a11y": "^6.7.1", @@ -47,7 +48,7 @@ "husky": "^8.0.3", "lint-staged": "^13.2.2", "prettier": "^3.4.2", - "typescript": "^5.1.3" + "typescript": "^5.6.3" }, "keywords": [ "react-hook-form", @@ -60,7 +61,8 @@ "dev": "next dev", "format": "prettier . --check", "format:fix": "prettier . --write", - "lint": "next lint --fix", + "lint": "next lint", + "lint:fix": "next lint --fix", "now-build": "pnpm run build", "start": "next start", "typecheck": "tsc --noEmit", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f0acb94f1..90ac6ffef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: dependencies: '@hookform/devtools': specifier: 4.3.1 - version: 4.3.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + version: 4.3.1(@types/react@18.3.11)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@mdx-js/loader': specifier: ^2.3.0 version: 2.3.0(webpack@5.95.0(esbuild@0.24.0)) @@ -93,20 +93,23 @@ importers: '@next/bundle-analyzer': specifier: ^13.4.5 version: 13.5.7 + '@types/react': + specifier: ^18.3.11 + version: 18.3.11 '@types/react-helmet': specifier: ^6.1.6 version: 6.1.11 '@typescript-eslint/eslint-plugin': - specifier: ^5.59.11 - version: 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3) + specifier: ^8.18.0 + version: 8.18.0(@typescript-eslint/parser@8.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3) '@typescript-eslint/parser': - specifier: ^5.59.11 - version: 5.62.0(eslint@8.57.1)(typescript@5.6.3) + specifier: ^8.18.0 + version: 8.18.0(eslint@8.57.1)(typescript@5.6.3) cross-env: specifier: ^7.0.3 version: 7.0.3 eslint: - specifier: ^8.42.0 + specifier: ^8.57.1 version: 8.57.1 eslint-config-next: specifier: ^13.4.5 @@ -133,7 +136,7 @@ importers: specifier: ^3.4.2 version: 3.4.2 typescript: - specifier: ^5.1.3 + specifier: ^5.6.3 version: 5.6.3 packages: @@ -849,22 +852,16 @@ packages: '@types/resolve@1.20.6': resolution: {integrity: sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==} - '@types/semver@7.5.8': - resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@types/unist@2.0.11': resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} - '@typescript-eslint/eslint-plugin@5.62.0': - resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/eslint-plugin@8.18.0': + resolution: {integrity: sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' '@typescript-eslint/parser@5.62.0': resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} @@ -876,24 +873,36 @@ packages: typescript: optional: true + '@typescript-eslint/parser@8.18.0': + resolution: {integrity: sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' + '@typescript-eslint/scope-manager@5.62.0': resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/type-utils@5.62.0': - resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/scope-manager@8.18.0': + resolution: {integrity: sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/type-utils@8.18.0': + resolution: {integrity: sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' '@typescript-eslint/types@5.62.0': resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/types@8.18.0': + resolution: {integrity: sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/typescript-estree@5.62.0': resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -903,16 +912,27 @@ packages: typescript: optional: true - '@typescript-eslint/utils@5.62.0': - resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/typescript-estree@8.18.0': + resolution: {integrity: sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '>=4.8.4 <5.8.0' + + '@typescript-eslint/utils@8.18.0': + resolution: {integrity: sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' '@typescript-eslint/visitor-keys@5.62.0': resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/visitor-keys@8.18.0': + resolution: {integrity: sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -1106,6 +1126,9 @@ packages: brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} @@ -1528,6 +1551,10 @@ packages: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + eslint-visitor-keys@4.2.0: + resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint@8.57.1: resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2382,6 +2409,10 @@ packages: minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} + minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -2404,9 +2435,6 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -3023,6 +3051,12 @@ packages: trough@2.2.0: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} + ts-api-utils@1.4.3: + resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + ts-pattern@4.3.0: resolution: {integrity: sha512-pefrkcd4lmIVR0LA49Imjf9DYLK8vtWhqBPA3Ya1ir8xCW0O2yjL9dsCVvI7pCodLC5q7smNpEtDR2yVulQxOg==} @@ -3479,7 +3513,7 @@ snapshots: '@emotion/memoize@0.9.0': {} - '@emotion/react@11.13.3(react@18.2.0)': + '@emotion/react@11.13.3(@types/react@18.3.11)(react@18.2.0)': dependencies: '@babel/runtime': 7.25.7 '@emotion/babel-plugin': 11.12.0 @@ -3490,6 +3524,8 @@ snapshots: '@emotion/weak-memoize': 0.4.0 hoist-non-react-statics: 3.3.2 react: 18.2.0 + optionalDependencies: + '@types/react': 18.3.11 transitivePeerDependencies: - supports-color @@ -3503,16 +3539,18 @@ snapshots: '@emotion/sheet@1.4.0': {} - '@emotion/styled@11.13.0(@emotion/react@11.13.3(react@18.2.0))(react@18.2.0)': + '@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.2.0))(@types/react@18.3.11)(react@18.2.0)': dependencies: '@babel/runtime': 7.25.7 '@emotion/babel-plugin': 11.12.0 '@emotion/is-prop-valid': 1.3.1 - '@emotion/react': 11.13.3(react@18.2.0) + '@emotion/react': 11.13.3(@types/react@18.3.11)(react@18.2.0) '@emotion/serialize': 1.3.2 '@emotion/use-insertion-effect-with-fallbacks': 1.1.0(react@18.2.0) '@emotion/utils': 1.4.1 react: 18.2.0 + optionalDependencies: + '@types/react': 18.3.11 transitivePeerDependencies: - supports-color @@ -3645,10 +3683,10 @@ snapshots: protobufjs: 7.4.0 yargs: 17.7.2 - '@hookform/devtools@4.3.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + '@hookform/devtools@4.3.1(@types/react@18.3.11)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: - '@emotion/react': 11.13.3(react@18.2.0) - '@emotion/styled': 11.13.0(@emotion/react@11.13.3(react@18.2.0))(react@18.2.0) + '@emotion/react': 11.13.3(@types/react@18.3.11)(react@18.2.0) + '@emotion/styled': 11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.2.0))(@types/react@18.3.11)(react@18.2.0) '@types/lodash': 4.17.12 little-state-machine: 4.8.0(react@18.2.0) lodash: 4.17.21 @@ -4016,25 +4054,21 @@ snapshots: '@types/resolve@1.20.6': {} - '@types/semver@7.5.8': {} - '@types/unist@2.0.11': {} - '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3)': + '@typescript-eslint/eslint-plugin@8.18.0(@typescript-eslint/parser@8.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3)': dependencies: '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 5.62.0(eslint@8.57.1)(typescript@5.6.3) - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.57.1)(typescript@5.6.3) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@5.6.3) - debug: 4.3.7 + '@typescript-eslint/parser': 8.18.0(eslint@8.57.1)(typescript@5.6.3) + '@typescript-eslint/scope-manager': 8.18.0 + '@typescript-eslint/type-utils': 8.18.0(eslint@8.57.1)(typescript@5.6.3) + '@typescript-eslint/utils': 8.18.0(eslint@8.57.1)(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 8.18.0 eslint: 8.57.1 graphemer: 1.4.0 ignore: 5.3.2 - natural-compare-lite: 1.4.0 - semver: 7.6.3 - tsutils: 3.21.0(typescript@5.6.3) - optionalDependencies: + natural-compare: 1.4.0 + ts-api-utils: 1.4.3(typescript@5.6.3) typescript: 5.6.3 transitivePeerDependencies: - supports-color @@ -4051,25 +4085,43 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/parser@8.18.0(eslint@8.57.1)(typescript@5.6.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.18.0 + '@typescript-eslint/types': 8.18.0 + '@typescript-eslint/typescript-estree': 8.18.0(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 8.18.0 + debug: 4.3.7 + eslint: 8.57.1 + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/scope-manager@5.62.0': dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - '@typescript-eslint/type-utils@5.62.0(eslint@8.57.1)(typescript@5.6.3)': + '@typescript-eslint/scope-manager@8.18.0': dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.6.3) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@5.6.3) + '@typescript-eslint/types': 8.18.0 + '@typescript-eslint/visitor-keys': 8.18.0 + + '@typescript-eslint/type-utils@8.18.0(eslint@8.57.1)(typescript@5.6.3)': + dependencies: + '@typescript-eslint/typescript-estree': 8.18.0(typescript@5.6.3) + '@typescript-eslint/utils': 8.18.0(eslint@8.57.1)(typescript@5.6.3) debug: 4.3.7 eslint: 8.57.1 - tsutils: 3.21.0(typescript@5.6.3) - optionalDependencies: + ts-api-utils: 1.4.3(typescript@5.6.3) typescript: 5.6.3 transitivePeerDependencies: - supports-color '@typescript-eslint/types@5.62.0': {} + '@typescript-eslint/types@8.18.0': {} + '@typescript-eslint/typescript-estree@5.62.0(typescript@5.6.3)': dependencies: '@typescript-eslint/types': 5.62.0 @@ -4084,26 +4136,41 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@5.62.0(eslint@8.57.1)(typescript@5.6.3)': + '@typescript-eslint/typescript-estree@8.18.0(typescript@5.6.3)': + dependencies: + '@typescript-eslint/types': 8.18.0 + '@typescript-eslint/visitor-keys': 8.18.0 + debug: 4.3.7 + fast-glob: 3.3.2 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.4.3(typescript@5.6.3) + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.18.0(eslint@8.57.1)(typescript@5.6.3)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.6.3) + '@typescript-eslint/scope-manager': 8.18.0 + '@typescript-eslint/types': 8.18.0 + '@typescript-eslint/typescript-estree': 8.18.0(typescript@5.6.3) eslint: 8.57.1 - eslint-scope: 5.1.1 - semver: 7.6.3 + typescript: 5.6.3 transitivePeerDependencies: - supports-color - - typescript '@typescript-eslint/visitor-keys@5.62.0': dependencies: '@typescript-eslint/types': 5.62.0 eslint-visitor-keys: 3.4.3 + '@typescript-eslint/visitor-keys@8.18.0': + dependencies: + '@typescript-eslint/types': 8.18.0 + eslint-visitor-keys: 4.2.0 + '@ungap/structured-clone@1.2.0': {} '@webassemblyjs/ast@1.12.1': @@ -4342,6 +4409,10 @@ snapshots: balanced-match: 1.0.2 concat-map: 0.0.1 + brace-expansion@2.0.1: + dependencies: + balanced-match: 1.0.2 + braces@3.0.3: dependencies: fill-range: 7.1.1 @@ -4775,7 +4846,7 @@ snapshots: eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1) eslint-plugin-jsx-a11y: 6.10.0(eslint@8.57.1) eslint-plugin-react: 7.37.1(eslint@8.57.1) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.1) @@ -4810,7 +4881,7 @@ snapshots: is-bun-module: 1.2.1 is-glob: 4.0.3 optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1) transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node @@ -4828,7 +4899,17 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1): + dependencies: + debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 8.18.0(eslint@8.57.1)(typescript@5.6.3) + eslint: 8.57.1 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -4839,7 +4920,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -4851,7 +4932,7 @@ snapshots: string.prototype.trimend: 1.0.8 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.57.1)(typescript@5.6.3) + '@typescript-eslint/parser': 8.18.0(eslint@8.57.1)(typescript@5.6.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -4915,6 +4996,8 @@ snapshots: eslint-visitor-keys@3.4.3: {} + eslint-visitor-keys@4.2.0: {} + eslint@8.57.1: dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) @@ -6109,6 +6192,10 @@ snapshots: dependencies: brace-expansion: 1.1.11 + minimatch@9.0.5: + dependencies: + brace-expansion: 2.0.1 + minimist@1.2.8: {} mri@1.2.0: {} @@ -6121,8 +6208,6 @@ snapshots: nanoid@3.3.7: {} - natural-compare-lite@1.4.0: {} - natural-compare@1.4.0: {} neo-async@2.6.2: {} @@ -6801,6 +6886,10 @@ snapshots: trough@2.2.0: {} + ts-api-utils@1.4.3(typescript@5.6.3): + dependencies: + typescript: 5.6.3 + ts-pattern@4.3.0: {} tsconfig-paths@3.15.0: diff --git a/src/components/ApiFormState.tsx b/src/components/ApiFormState.tsx index 63eda517b..d5ac7abec 100644 --- a/src/components/ApiFormState.tsx +++ b/src/components/ApiFormState.tsx @@ -1,4 +1,5 @@ import { memo } from "react" +import API from "../data/api" import typographyStyles from "../styles/typography.module.css" import FormStateTable from "./FormStateTable" import TabGroup from "./TabGroup" @@ -6,7 +7,7 @@ import CodeArea from "./CodeArea" import formStateUseEffect from "./codeExamples/formStateUseEffect" import formStateUseEffectTs from "./codeExamples/formStateUseEffectTs" -function ApiFormState({ api }: { api: any }) { +function ApiFormState({ api }: { api: typeof API }) { return ( <> diff --git a/src/components/ApiRefTable.tsx b/src/components/ApiRefTable.tsx index 9f30a9668..076b14b0d 100644 --- a/src/components/ApiRefTable.tsx +++ b/src/components/ApiRefTable.tsx @@ -1,13 +1,14 @@ import { useState } from "react" import CodeArea from "./CodeArea" import generic from "../data/generic" +import apiData from "../data/api" import typographyStyles from "../styles/typography.module.css" import tableStyles from "../styles/table.module.css" import styles from "./ApiRefTable.module.css" import register from "./codeExamples/register" import registerTs from "./codeExamples/registerTs" -export default function ApiRefTable({ api }: { api: any }) { +export default function ApiRefTable({ api }: { api: typeof apiData }) { const [isStandard, toggleOption] = useState(true) return ( diff --git a/src/components/BuilderPage.tsx b/src/components/BuilderPage.tsx index eae76ca6d..008823291 100644 --- a/src/components/BuilderPage.tsx +++ b/src/components/BuilderPage.tsx @@ -1,3 +1,5 @@ +import { useState, useRef, useEffect, memo, RefObject } from "react" +import { useRouter } from "next/router" import { Animate } from "react-simple-animate" import { useForm } from "react-hook-form" import SortableContainer from "./SortableContainer" @@ -16,10 +18,8 @@ import containerStyles from "../styles/container.module.css" import typographyStyles from "../styles/typography.module.css" import CodeArea from "./CodeArea" import ClipBoard from "./ClipBoard" -import { useState, useRef, useEffect, memo, RefObject } from "react" import styles from "./BuilderPage.module.css" import { BeekaiBuilderPage } from "./BeekaiBuilderPage" -import { useRouter } from "next/router" const errorStyle = { border: `1px solid ${colors.secondary}`, @@ -110,15 +110,15 @@ function BuilderPage({ useEffect(() => { setValue("toggle", shouldToggleOn) - }, [shouldToggleOn]) + }, [setValue, shouldToggleOn]) useEffect(() => { if (editFormData.type) setValue("type", editFormData.type) - }, [editFormData.type]) + }, [editFormData.type, setValue]) useEffect(() => { setValue("required", editFormData.required) - }, [editIndex]) + }, [editFormData.required, editIndex, setValue]) const child = (
diff --git a/src/components/CodeCompareSection.tsx b/src/components/CodeCompareSection.tsx index e08262614..e2a10c8d2 100644 --- a/src/components/CodeCompareSection.tsx +++ b/src/components/CodeCompareSection.tsx @@ -2,7 +2,6 @@ import { memo } from "react" import reactHookFormCode from "./codeExamples/reactHookFormCode" import CodeArea from "./CodeArea" import { AnimateGroup, Animate } from "react-simple-animate" -import colors from "../styles/colors" import home from "../data/home" import typographyStyles from "../styles/typography.module.css" import containerStyles from "../styles/container.module.css" diff --git a/src/components/DevToolFeaturesList.tsx b/src/components/DevToolFeaturesList.tsx index 58d864613..524f133de 100644 --- a/src/components/DevToolFeaturesList.tsx +++ b/src/components/DevToolFeaturesList.tsx @@ -2,6 +2,7 @@ import { memo } from "react" import { AnimateGroup, AnimateKeyframes } from "react-simple-animate" import home from "../data/home" import generic from "../data/generic" +import type devToolsContent from "../data/devtools" import typographyStyles from "../styles/typography.module.css" import styles from "./DevToolFeaturesList.module.css" import { AnimateKeyframesProps } from "react-simple-animate/dist/types" @@ -18,16 +19,15 @@ const animationKeyFramesProps: AnimateKeyframesProps = { } interface Props { - isPlayFeature: boolean - content: any + content: typeof devToolsContent } -function FeaturesList({ isPlayFeature, content }: Props) { +const FeaturesList = ({ content }: Props) => { return (

{generic.features}

- +
diff --git a/src/components/DevTools.tsx b/src/components/DevTools.tsx index 2cda3967a..5f96e667d 100644 --- a/src/components/DevTools.tsx +++ b/src/components/DevTools.tsx @@ -8,6 +8,7 @@ import CodeArea from "./CodeArea" import code from "./codeExamples/devTool" import copyClipBoard from "./utils/copyClipBoard" import generic from "../data/generic" +import content from "../data/devtools" import typographyStyles from "../styles/typography.module.css" import containerStyles from "../styles/container.module.css" import buttonStyles from "../styles/button.module.css" @@ -27,11 +28,7 @@ const DevTool = dynamic( } ) -interface Props { - content: any -} - -export default function DevTools({ content }: Props) { +export default function DevTools() { const methods = useForm({ mode: "onChange", }) @@ -68,7 +65,7 @@ export default function DevTools({ content }: Props) { )} /> - +

@@ -126,16 +123,12 @@ export default function DevTools({ content }: Props) {
{}, - // eslint-disable-next-line @typescript-eslint/no-empty-function - formUpdated: () => {}, - methods, - devTool: true, - }} + onSubmit={onSubmit} + submitData={{}} + toggleBuilder={() => {}} + methods={methods} + formUpdated + devTool />
diff --git a/src/components/Form.tsx b/src/components/Form.tsx index 4ec7da30b..0226712ca 100644 --- a/src/components/Form.tsx +++ b/src/components/Form.tsx @@ -29,11 +29,11 @@ function Form({ methods, devTool, }: { - onSubmit: (data: any) => void - submitData: any + onSubmit: (data: Record) => void + submitData: Record toggleBuilder: (state: boolean) => void formUpdated: boolean - methods: UseFormReturn + methods: UseFormReturn, undefined> devTool?: boolean }) { const { register, handleSubmit, watch, formState, reset } = methods @@ -138,6 +138,7 @@ function Form({ JSON.stringify( Object.entries(errors).reduce( // @ts-expect-error needed for previous + // eslint-disable-next-line @typescript-eslint/no-unused-vars (previous, [key, { ref, ...rest }]) => { previous[key] = rest return previous diff --git a/src/components/FormStateApi.tsx b/src/components/FormStateApi.tsx index b0b7090b2..a796ff59f 100644 --- a/src/components/FormStateApi.tsx +++ b/src/components/FormStateApi.tsx @@ -1,29 +1,12 @@ import typographyStyles from "../styles/typography.module.css" import API from "../data/api" import Link from "next/link" -import { ReactNode } from "react" export const FormStateApi = ({ api, columnIndent, }: { - api?: { - formState: { - isDirty: ReactNode | string - dirtyFields: ReactNode | string - defaultValues: ReactNode | string - touched: ReactNode | string - isSubmitted: ReactNode | string - isSubmitSuccessful: ReactNode | string - isSubmitting: ReactNode | string - submitCount: ReactNode | string - isValid: ReactNode | string - isValidating: ReactNode | string - isLoading: ReactNode | string - validatingFields: ReactNode | string - disabled: ReactNode | string - } - } + api?: Pick columnIndent?: boolean }) => ( <> diff --git a/src/components/FormStateTable.tsx b/src/components/FormStateTable.tsx index 6fdd61caa..07e665f3a 100644 --- a/src/components/FormStateTable.tsx +++ b/src/components/FormStateTable.tsx @@ -1,9 +1,10 @@ import generic from "../data/generic" +import API from "../data/api" import typographyStyles from "../styles/typography.module.css" import tableStyles from "../styles/table.module.css" import { FormStateApi } from "./FormStateApi" -export default function FormStateTable({ api }) { +export default function FormStateTable({ api }: { api: typeof API }) { return ( <>

diff --git a/src/components/SortableContainer.tsx b/src/components/SortableContainer.tsx index c412d0d81..a7532871a 100644 --- a/src/components/SortableContainer.tsx +++ b/src/components/SortableContainer.tsx @@ -1,5 +1,6 @@ import Sortable from "react-sortablejs" import { Animate } from "react-simple-animate" +import type { GlobalState } from "little-state-machine" import colors from "../styles/colors" import generic from "../data/generic" import originalFormData from "../state/formData" @@ -14,7 +15,7 @@ export default function SortableContainer({ reset, }: { updateFormData: (data: object) => void - formData: any + formData: GlobalState["formData"] editIndex: number setEditIndex: (payload: number) => void setFormData: (payload: object) => void diff --git a/src/components/UseController.tsx b/src/components/UseController.tsx index 498333232..2b7b8d162 100644 --- a/src/components/UseController.tsx +++ b/src/components/UseController.tsx @@ -1,4 +1,3 @@ -import api from "../data/api" import typographyStyles from "../styles/typography.module.css" import Footer from "./Footer" import containerStyles from "../styles/container.module.css" @@ -21,7 +20,7 @@ export default function UseController() {
- +
diff --git a/src/components/UseControllerContent.tsx b/src/components/UseControllerContent.tsx index 904806f03..251275046 100644 --- a/src/components/UseControllerContent.tsx +++ b/src/components/UseControllerContent.tsx @@ -1,5 +1,6 @@ -import CodeArea from "./CodeArea" +import api from "../data/api" import generic from "../data/generic" +import CodeArea from "./CodeArea" import useController from "./codeExamples/useController" import useControllerTs from "./codeExamples/useControllerTs" import tableStyles from "../styles/table.module.css" @@ -9,7 +10,7 @@ import TabGroup from "./TabGroup" import useControllerCheckboxes from "./codeExamples/useControllerCheckboxes" import { SelectNav } from "./selectNav" -export default function UseControllerContent({ api }: { api: any }) { +export default function UseControllerContent() { return ( <> name - + string - +

Input's name being registered.

@@ -137,9 +137,9 @@ const UseControllerMethods = ({ ref - + React.Ref - +

A ref used to connect hook form to the input. Assign{" "} diff --git a/src/components/UseFieldArray.tsx b/src/components/UseFieldArray.tsx index 92822e07c..23bc17140 100644 --- a/src/components/UseFieldArray.tsx +++ b/src/components/UseFieldArray.tsx @@ -1,4 +1,3 @@ -import api from "../data/api" import typographyStyles from "../styles/typography.module.css" import Footer from "./Footer" import containerStyles from "../styles/container.module.css" @@ -19,7 +18,7 @@ export default function UseFieldArray() {

- +
diff --git a/src/components/UseFieldArrayContent.tsx b/src/components/UseFieldArrayContent.tsx index 71d4d9d82..3271b3a5c 100644 --- a/src/components/UseFieldArrayContent.tsx +++ b/src/components/UseFieldArrayContent.tsx @@ -1,4 +1,5 @@ import generic from "../data/generic" +import api from "../data/api" import CodeArea from "./CodeArea" import useFieldArray from "./codeExamples/useFieldArray" import typographyStyles from "../styles/typography.module.css" @@ -10,7 +11,7 @@ import useFieldArrayFocus from "./codeExamples/useFieldArrayFocus" import Link from "next/link" import useFieldArrayPreview from "./codeExamples/useFieldArrayPreview" -export default function UseFieldArrayContent({ api }: { api: any }) { +export default function UseFieldArrayContent() { return ( <> diff --git a/src/components/general-observer.tsx b/src/components/general-observer.tsx index 81800ea16..f1c3d64f6 100644 --- a/src/components/general-observer.tsx +++ b/src/components/general-observer.tsx @@ -28,7 +28,7 @@ export const GeneralObserver: FunctionComponent = ({ ([entry]) => { if (entry.isIntersecting) { setIsChildVisible(true) - onEnter && onEnter() + onEnter?.() } }, { diff --git a/src/components/logic/generateCode.ts b/src/components/logic/generateCode.ts index 355f245ba..068603b78 100644 --- a/src/components/logic/generateCode.ts +++ b/src/components/logic/generateCode.ts @@ -1,4 +1,6 @@ -export default (formData: any) => { +import { GlobalState } from "little-state-machine" + +export default (formData: GlobalState["formData"]) => { return `import React from 'react'; import { useForm } from 'react-hook-form'; @@ -46,7 +48,7 @@ ${ required ? `("${name}", { required: true })` : `("${name}")` }}` if (type === "select") { - const select = ` \n${(options || "") .split(";") .filter(Boolean) .reduce((temp, option) => { @@ -60,7 +62,7 @@ ${ } if (type === "radio") { - const select = `\n${options + const select = `\n${(options || "") .split(";") .filter(Boolean) .reduce((temp, option) => { diff --git a/src/components/selectNav.tsx b/src/components/selectNav.tsx index 7ec84457e..a6831938d 100644 --- a/src/components/selectNav.tsx +++ b/src/components/selectNav.tsx @@ -12,6 +12,7 @@ export function SelectNav({ options }: Props) { const router = useRouter() return ( + // eslint-disable-next-line jsx-a11y/no-onchange