From fdb323052e197ba1846b674e745fe20d8913c2db Mon Sep 17 00:00:00 2001 From: "compulim-workflow-bot[bot]" <145930250+compulim-workflow-bot[bot]@users.noreply.github.com> Date: Sun, 13 Oct 2024 03:17:14 -0700 Subject: [PATCH] Bump scaffold (#64) * Bump scaffold * Add eslint-import-resolver-* * Add triple-slash reference * Fix extension * Revert --------- Co-authored-by: @compulim <@compulim> Co-authored-by: William Wong --- .eslintrc.jest.yml | 1 + .eslintrc.production.yml | 11 +- .eslintrc.typescript.yml | 3 + .eslintrc.yml | 4 - package-lock.json | 127 +++++++++++++++++- package.json | 5 +- .../integration-test/.eslintrc.custom.yml | 2 + packages/integration-test/.eslintrc.yml | 3 +- packages/integration-test/jest.config.json | 38 ++++++ packages/integration-test/package.json | 5 +- .../integration-test/tsconfig.custom.json | 3 + packages/integration-test/tsconfig.json | 7 + packages/iter-fest/.eslintrc.custom.yml | 0 packages/iter-fest/.eslintrc.yml | 2 + .../__setup__/typingTestTransformer.js | 1 + packages/iter-fest/package.json | 5 +- packages/iter-fest/src/private/JestMockOf.ts | 2 + packages/iter-fest/src/tsconfig.custom.json | 3 + packages/iter-fest/src/tsconfig.json | 8 +- .../src/tsconfig.precommit.production.json | 13 +- .../src/tsconfig.precommit.test.json | 14 +- packages/pages/.eslintrc.custom.yml | 0 packages/pages/.eslintrc.yml | 4 + packages/pages/package.json | 6 +- packages/pages/src/app/index.tsx | 2 +- packages/pages/src/tsconfig.custom.json | 3 + packages/pages/src/tsconfig.json | 12 +- 27 files changed, 251 insertions(+), 33 deletions(-) create mode 100644 packages/integration-test/.eslintrc.custom.yml create mode 100644 packages/integration-test/jest.config.json create mode 100644 packages/integration-test/tsconfig.custom.json create mode 100644 packages/integration-test/tsconfig.json create mode 100644 packages/iter-fest/.eslintrc.custom.yml create mode 100644 packages/iter-fest/.eslintrc.yml create mode 100644 packages/iter-fest/src/tsconfig.custom.json create mode 100644 packages/pages/.eslintrc.custom.yml create mode 100644 packages/pages/.eslintrc.yml create mode 100644 packages/pages/src/tsconfig.custom.json diff --git a/.eslintrc.jest.yml b/.eslintrc.jest.yml index 4340ddd..0255384 100644 --- a/.eslintrc.jest.yml +++ b/.eslintrc.jest.yml @@ -8,3 +8,4 @@ rules: react/display-name: off # Disable for convenience react/prop-types: off + '@typescript-eslint/no-require-imports': off diff --git a/.eslintrc.production.yml b/.eslintrc.production.yml index c06268b..b63635d 100644 --- a/.eslintrc.production.yml +++ b/.eslintrc.production.yml @@ -24,13 +24,17 @@ rules: import/exports-last: error import/extensions: - error - - always + - ignorePackages # eslint-plugin-import does not understand named import import/first: error import/newline-after-import: error import/no-anonymous-default-export: error import/no-duplicates: error import/no-namespace: error - import/no-unassigned-import: error + import/no-unassigned-import: + - error + - allow: + - '**/*.css' + - dotenv/config settings: import/extensions: - .cjs @@ -41,3 +45,6 @@ settings: - .mts - .ts - .tsx + import/resolver: + node: true + typescript: true diff --git a/.eslintrc.typescript.yml b/.eslintrc.typescript.yml index 3ea0b00..5de2aeb 100644 --- a/.eslintrc.typescript.yml +++ b/.eslintrc.typescript.yml @@ -4,6 +4,9 @@ parser: '@typescript-eslint/parser' plugins: - '@typescript-eslint' rules: + # Shortening if-statement into &&, ||, or ternary operators. + '@typescript-eslint/no-unused-expressions': off + '@typescript-eslint/no-unused-vars': - error - argsIgnorePattern: ^_ diff --git a/.eslintrc.yml b/.eslintrc.yml index ca1a942..ddb1c8c 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,8 +1,5 @@ -env: - browser: true extends: - eslint:recommended - # - plugin:import/recommended overrides: - extends: .eslintrc.react.yml files: @@ -67,7 +64,6 @@ parserOptions: ecmaVersion: latest sourceType: module plugins: - # - import - prettier root: true rules: diff --git a/package-lock.json b/package-lock.json index d553f87..e406739 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,8 @@ "@typescript-eslint/eslint-plugin": "^7.4.0", "@typescript-eslint/parser": "^7.4.0", "eslint": "^8.57.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-import-resolver-typescript": "^3.6.3", "eslint-plugin-import": "^2.30.0", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.34.1", @@ -3062,6 +3064,15 @@ "node": ">= 8" } }, + "node_modules/@nolyfill/is-core-module": { + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", + "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", + "dev": true, + "engines": { + "node": ">=12.4.0" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -5044,6 +5055,19 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "node_modules/enhanced-resolve": { + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -5395,6 +5419,64 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.3.tgz", + "integrity": "sha512-ud9aw4szY9cCT1EWWdGv1L1XR6hh2PaRWif0j2QjQ0pgTY/69iw+W0Z4qZv5wHahOl8isEr+k/JnyAqNQkLkIA==", + "dev": true, + "dependencies": { + "@nolyfill/is-core-module": "1.0.39", + "debug": "^4.3.5", + "enhanced-resolve": "^5.15.0", + "eslint-module-utils": "^2.8.1", + "fast-glob": "^3.3.2", + "get-tsconfig": "^4.7.5", + "is-bun-module": "^1.0.2", + "is-glob": "^4.0.3" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*", + "eslint-plugin-import-x": "*" + }, + "peerDependenciesMeta": { + "eslint-plugin-import": { + "optional": true + }, + "eslint-plugin-import-x": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-typescript/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-typescript/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "node_modules/eslint-module-utils": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.11.0.tgz", @@ -6101,6 +6183,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz", + "integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -6570,6 +6664,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-bun-module": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.2.1.tgz", + "integrity": "sha512-AmidtEM6D6NmUiLOvvU7+IePxjEjOzra2h0pSrsfSAcXwl/83zLLXDByafUJy9k/rKK0pvXMLdwKwGHlX2Ke6Q==", + "dev": true, + "dependencies": { + "semver": "^7.6.3" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -9470,6 +9573,15 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9656,9 +9768,9 @@ } }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -10112,6 +10224,15 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", diff --git a/package.json b/package.json index 6db1ef2..ee6e576 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,7 @@ ], "scripts": { "build": "npm run build --if-present --workspaces", - "bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix && npm run bump:packages && npm run bump:eslintrc", - "bump:auditfix": "npm audit fix || exit 0", + "bump": "npm run bump:prod && npm run bump:dev && npm run bump:packages && npm run bump:eslintrc", "bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", "bump:eslintrc": "if [ -f node_modules/react/package.json ]; then docker run -e VERSION=$(cat node_modules/react/package.json | jq -r '.version') -i --rm mikefarah/yq '.settings.react.version = strenv(VERSION)' < ./.eslintrc.react.yml | tee /tmp/output.tmp && mv /tmp/output.tmp ./.eslintrc.react.yml; fi", "bump:packages": "npm run bump --if-present --workspaces", @@ -28,6 +27,8 @@ "@typescript-eslint/eslint-plugin": "^7.4.0", "@typescript-eslint/parser": "^7.4.0", "eslint": "^8.57.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-import-resolver-typescript": "^3.6.3", "eslint-plugin-import": "^2.30.0", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.34.1", diff --git a/packages/integration-test/.eslintrc.custom.yml b/packages/integration-test/.eslintrc.custom.yml new file mode 100644 index 0000000..5c9fc4c --- /dev/null +++ b/packages/integration-test/.eslintrc.custom.yml @@ -0,0 +1,2 @@ +env: + browser: true diff --git a/packages/integration-test/.eslintrc.yml b/packages/integration-test/.eslintrc.yml index d4f0beb..54b2959 100644 --- a/packages/integration-test/.eslintrc.yml +++ b/packages/integration-test/.eslintrc.yml @@ -1,3 +1,2 @@ extends: - - ../../.eslintrc.mocha.yml - - ../../.eslintrc.react.yml + - ./.eslintrc.custom.yml diff --git a/packages/integration-test/jest.config.json b/packages/integration-test/jest.config.json new file mode 100644 index 0000000..9c305d4 --- /dev/null +++ b/packages/integration-test/jest.config.json @@ -0,0 +1,38 @@ +{ + "testMatch": ["**/__tests__/**/*.?([cm])[jt]s?(x)", "**/?(*.)+(spec|test).?([cm])[jt]s?(x)"], + "transform": { + "\\.cjsx?$": [ + "babel-jest", + { + "presets": [ + [ + "@babel/preset-react", + { + "runtime": "classic" + } + ] + ] + } + ], + "\\.mjsx?$": [ + "babel-jest", + { + "presets": [ + [ + "@babel/preset-react", + { + "runtime": "classic" + } + ], + [ + "@babel/preset-env", + { + "modules": "commonjs", + "targets": "defaults" + } + ] + ] + } + ] + } +} diff --git a/packages/integration-test/package.json b/packages/integration-test/package.json index 7c5077e..97ec759 100644 --- a/packages/integration-test/package.json +++ b/packages/integration-test/package.json @@ -4,11 +4,10 @@ "description": "", "private": true, "scripts": { - "bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix", - "bump:auditfix": "npm audit fix || exit 0", + "bump": "npm run bump:prod && npm run bump:dev", "bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", "bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", - "precommit": "eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts ./", + "precommit": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts ./", "switch": "cat package.json | jq --arg SWITCH_NAME $SWITCH_NAME -r '(.[\"switch:\" + $SWITCH_NAME] // {}) as $TEMPLATE | .devDependencies += ($TEMPLATE.devDependencies // {}) | .dependencies += ($TEMPLATE.dependencies // {})' | tee ./package.json.tmp && mv ./package.json.tmp ./package.json", "test": "mocha --recursive" }, diff --git a/packages/integration-test/tsconfig.custom.json b/packages/integration-test/tsconfig.custom.json new file mode 100644 index 0000000..7a3b017 --- /dev/null +++ b/packages/integration-test/tsconfig.custom.json @@ -0,0 +1,3 @@ +{ + "extends": "@tsconfig/strictest/tsconfig.json" +} diff --git a/packages/integration-test/tsconfig.json b/packages/integration-test/tsconfig.json new file mode 100644 index 0000000..d910d6b --- /dev/null +++ b/packages/integration-test/tsconfig.json @@ -0,0 +1,7 @@ +// This configuration file is for VSCode only. +{ + "compilerOptions": { + "jsx": "react" + }, + "extends": "./tsconfig.custom.json" +} diff --git a/packages/iter-fest/.eslintrc.custom.yml b/packages/iter-fest/.eslintrc.custom.yml new file mode 100644 index 0000000..e69de29 diff --git a/packages/iter-fest/.eslintrc.yml b/packages/iter-fest/.eslintrc.yml new file mode 100644 index 0000000..54b2959 --- /dev/null +++ b/packages/iter-fest/.eslintrc.yml @@ -0,0 +1,2 @@ +extends: + - ./.eslintrc.custom.yml diff --git a/packages/iter-fest/__tests__/__setup__/typingTestTransformer.js b/packages/iter-fest/__tests__/__setup__/typingTestTransformer.js index eb4b6f3..b8d3ed5 100644 --- a/packages/iter-fest/__tests__/__setup__/typingTestTransformer.js +++ b/packages/iter-fest/__tests__/__setup__/typingTestTransformer.js @@ -8,6 +8,7 @@ const run = ({ filename }) => { const TS_EXPECT_ERROR = /(\/\/\s+)(@ts-expect-error)[\s+(.*)]/gu; const TSCONFIG = { + allowImportingTsExtensions: true, allowSyntheticDefaultImports: true, jsx: typeScript.JsxEmit.React, noEmit: true, diff --git a/packages/iter-fest/package.json b/packages/iter-fest/package.json index 28482c1..d82005e 100644 --- a/packages/iter-fest/package.json +++ b/packages/iter-fest/package.json @@ -521,12 +521,11 @@ "typings": "./dist/iter-fest.d.ts", "scripts": { "build": "tsup", - "bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix", - "bump:auditfix": "npm audit fix || exit 0", + "bump": "npm run bump:prod && npm run bump:dev", "bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", "bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", "precommit": "npm run precommit:eslint && npm run precommit:publint && npm run precommit:typescript:production && npm run precommit:typescript:test", - "precommit:eslint": "eslint ./src/", + "precommit:eslint": "ESLINT_USE_FLAT_CONFIG=false eslint ./src/", "precommit:publint": "publint", "precommit:typescript:production": "tsc --noEmit --project ./src/tsconfig.precommit.production.json", "precommit:typescript:test": "tsc --noEmit --project ./src/tsconfig.precommit.test.json", diff --git a/packages/iter-fest/src/private/JestMockOf.ts b/packages/iter-fest/src/private/JestMockOf.ts index d480dcf..a33b9d4 100644 --- a/packages/iter-fest/src/private/JestMockOf.ts +++ b/packages/iter-fest/src/private/JestMockOf.ts @@ -1,3 +1,5 @@ +/// + // eslint-disable-next-line @typescript-eslint/no-explicit-any export type JestMockOf any> = jest.Mock< ReturnType, diff --git a/packages/iter-fest/src/tsconfig.custom.json b/packages/iter-fest/src/tsconfig.custom.json new file mode 100644 index 0000000..7a3b017 --- /dev/null +++ b/packages/iter-fest/src/tsconfig.custom.json @@ -0,0 +1,3 @@ +{ + "extends": "@tsconfig/strictest/tsconfig.json" +} diff --git a/packages/iter-fest/src/tsconfig.json b/packages/iter-fest/src/tsconfig.json index 2221ed4..b4c9c14 100644 --- a/packages/iter-fest/src/tsconfig.json +++ b/packages/iter-fest/src/tsconfig.json @@ -8,7 +8,11 @@ "moduleResolution": "Bundler", "noEmit": true, "strict": true, - "target": "ESNext" + "target": "ESNext", + "types": [ + "jest", + "node" + ] }, - "extends": "@tsconfig/strictest/tsconfig.json" + "extends": "./tsconfig.custom.json" } diff --git a/packages/iter-fest/src/tsconfig.precommit.production.json b/packages/iter-fest/src/tsconfig.precommit.production.json index da317fd..68f3ff3 100644 --- a/packages/iter-fest/src/tsconfig.precommit.production.json +++ b/packages/iter-fest/src/tsconfig.precommit.production.json @@ -7,8 +7,15 @@ "moduleResolution": "Bundler", "noEmit": true, "strict": true, - "target": "ESNext" + "target": "ESNext", + "types": [] }, - "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "__tests__/**/*"], - "extends": "@tsconfig/strictest/tsconfig.json" + "exclude": [ + "**/*.spec.ts", + "**/*.spec.tsx", + "**/*.test.ts", + "**/*.test.tsx", + "__tests__/**/*" + ], + "extends": "./tsconfig.custom.json" } diff --git a/packages/iter-fest/src/tsconfig.precommit.test.json b/packages/iter-fest/src/tsconfig.precommit.test.json index 8854991..54576c2 100644 --- a/packages/iter-fest/src/tsconfig.precommit.test.json +++ b/packages/iter-fest/src/tsconfig.precommit.test.json @@ -7,8 +7,18 @@ "moduleResolution": "Bundler", "noEmit": true, "strict": true, - "target": "ESNext" + "target": "ESNext", + "types": [ + "jest", + "node" + ] }, "extends": "@tsconfig/recommended/tsconfig.json", - "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "__tests__/**/*"] + "include": [ + "**/*.spec.ts", + "**/*.spec.tsx", + "**/*.test.ts", + "**/*.test.tsx", + "__tests__/**/*" + ] } diff --git a/packages/pages/.eslintrc.custom.yml b/packages/pages/.eslintrc.custom.yml new file mode 100644 index 0000000..e69de29 diff --git a/packages/pages/.eslintrc.yml b/packages/pages/.eslintrc.yml new file mode 100644 index 0000000..a8f533d --- /dev/null +++ b/packages/pages/.eslintrc.yml @@ -0,0 +1,4 @@ +env: + browser: true +extends: + - ./.eslintrc.custom.yml diff --git a/packages/pages/package.json b/packages/pages/package.json index 9998b50..a3af50a 100644 --- a/packages/pages/package.json +++ b/packages/pages/package.json @@ -5,11 +5,11 @@ "private": true, "scripts": { "build": "esbuild --bundle --entry-names=[name]/[ext]/main --jsx=automatic --minify --outdir=./public/static/ --sourcemap app=./src/app/index.tsx", - "bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix", - "bump:auditfix": "npm audit fix || exit 0", + "bump": "npm run bump:prod && npm run bump:dev", "bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", "bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", - "precommit": "npm run precommit:typescript", + "precommit": "npm run precommit:eslint && npm run precommit:typescript", + "precommit:eslint": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts ./src/", "precommit:typescript": "tsc --project ./src/tsconfig.json", "reinstall": "rm -r node_modules package-lock.json && npm install", "start": "npm run build -- --servedir=./public", diff --git a/packages/pages/src/app/index.tsx b/packages/pages/src/app/index.tsx index ff97c90..4ffbc34 100644 --- a/packages/pages/src/app/index.tsx +++ b/packages/pages/src/app/index.tsx @@ -3,7 +3,7 @@ import React from 'react'; // eslint-disable-next-line react/no-deprecated import { render } from 'react-dom'; -import App from './App'; +import App from './App.tsx'; const rootElement = document.getElementById('root'); diff --git a/packages/pages/src/tsconfig.custom.json b/packages/pages/src/tsconfig.custom.json new file mode 100644 index 0000000..7a3b017 --- /dev/null +++ b/packages/pages/src/tsconfig.custom.json @@ -0,0 +1,3 @@ +{ + "extends": "@tsconfig/strictest/tsconfig.json" +} diff --git a/packages/pages/src/tsconfig.json b/packages/pages/src/tsconfig.json index 4ac3c0b..017f0c9 100644 --- a/packages/pages/src/tsconfig.json +++ b/packages/pages/src/tsconfig.json @@ -1,12 +1,18 @@ { "compilerOptions": { + "allowImportingTsExtensions": true, "esModuleInterop": true, "jsx": "react", - "lib": ["DOM", "ESNext", "WebWorker"], + "lib": [ + "DOM", + "ESNext", + "WebWorker" + ], "moduleResolution": "Bundler", "noEmit": true, "strict": true, - "target": "ESNext" + "target": "ESNext", + "types": [] }, - "extends": "@tsconfig/strictest/tsconfig.json" + "extends": "./tsconfig.custom.json" }