diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec9d5e05713..46972d58253 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,6 +106,62 @@ jobs: - name: Check formatting run: pnpm prettier --check . + ts-check-scripts: + runs-on: ubuntu-latest + name: 'TS-Check Scripts: node-18, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 + + - name: Set node version to 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'pnpm' + + - name: Install deps + run: pnpm install + env: + CYPRESS_INSTALL_BINARY: 0 + + - name: Check scripts + run: pnpm run ts-check:scripts + + ts-check-tests: + runs-on: ubuntu-latest + name: 'TS-Check Tests: node-18, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 + + - name: Set node version to 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'pnpm' + + - name: Install deps + run: pnpm install + env: + CYPRESS_INSTALL_BINARY: 0 + + - name: Check tests + run: pnpm run ts-check:tests + codecov: runs-on: ubuntu-latest name: 'Codecov: node-18, ubuntu-latest' diff --git a/package.json b/package.json index 71916bc6af4..dd5cbc187f2 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,8 @@ "docs:serve": "vitepress serve docs", "format": "prettier --write .", "lint": "eslint --cache --cache-strategy content .", + "ts-check:scripts": "tsc --project tsconfig.check-scripts.json", + "ts-check:tests": "tsc --project tsconfig.check-tests.json", "test": "vitest", "coverage": "vitest run --coverage", "cypress": "cypress", @@ -98,7 +100,7 @@ "@types/validator": "~13.7.2", "@typescript-eslint/eslint-plugin": "~5.22.0", "@typescript-eslint/parser": "~5.22.0", - "@vitest/ui": "~0.10.2", + "@vitest/ui": "~0.10.5", "c8": "~7.11.2", "conventional-changelog-cli": "~2.2.2", "cypress": "~9.6.0", @@ -110,6 +112,7 @@ "eslint-plugin-jsdoc": "~39.2.9", "eslint-plugin-prettier": "~4.0.0", "esno": "~0.14.1", + "glob": "~8.0.1", "lint-staged": "~12.4.1", "mime-db": "~1.52.0", "npm-run-all": "~4.1.5", @@ -128,7 +131,7 @@ "validator": "~13.7.0", "vite": "~2.9.8", "vitepress": "~0.22.3", - "vitest": "~0.10.2" + "vitest": "~0.10.5" }, "packageManager": "pnpm@7.0.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 68289c95511..e6c2934b34b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ specifiers: '@types/validator': ~13.7.2 '@typescript-eslint/eslint-plugin': ~5.22.0 '@typescript-eslint/parser': ~5.22.0 - '@vitest/ui': ~0.10.2 + '@vitest/ui': ~0.10.5 c8: ~7.11.2 conventional-changelog-cli: ~2.2.2 cypress: ~9.6.0 @@ -22,6 +22,7 @@ specifiers: eslint-plugin-jsdoc: ~39.2.9 eslint-plugin-prettier: ~4.0.0 esno: ~0.14.1 + glob: ~8.0.1 lint-staged: ~12.4.1 mime-db: ~1.52.0 npm-run-all: ~4.1.5 @@ -40,7 +41,7 @@ specifiers: validator: ~13.7.0 vite: ~2.9.8 vitepress: ~0.22.3 - vitest: ~0.10.2 + vitest: ~0.10.5 devDependencies: '@algolia/client-search': 4.13.0 @@ -52,7 +53,7 @@ devDependencies: '@types/validator': 13.7.2 '@typescript-eslint/eslint-plugin': 5.22.0_lnjlwhtxjffjmj5o7dnwvwyqxq '@typescript-eslint/parser': 5.22.0_t725usgvqspm5woeqpaxbfp2qu - '@vitest/ui': 0.10.2 + '@vitest/ui': 0.10.5 c8: 7.11.2 conventional-changelog-cli: 2.2.2 cypress: 9.6.0 @@ -64,6 +65,7 @@ devDependencies: eslint-plugin-jsdoc: 39.2.9_eslint@8.14.0 eslint-plugin-prettier: 4.0.0_mzpligoj26dazigcet37nxg2zy esno: 0.14.1 + glob: 8.0.1 lint-staged: 12.4.1 mime-db: 1.52.0 npm-run-all: 4.1.5 @@ -82,7 +84,7 @@ devDependencies: validator: 13.7.0 vite: 2.9.8 vitepress: 0.22.3_kn36e22syauasb4m7s72m2cfwa - vitest: 0.10.2_psihcmhmrlrkhevakbcy5k6nlu + vitest: 0.10.5_2jfoe7rfkpxojpgvnil25xksju packages: @@ -624,8 +626,8 @@ packages: vue: 3.2.33 dev: true - /@vitest/ui/0.10.2: - resolution: {integrity: sha512-sFaTxareiJwBJNNyw+fHLbsvpFSYI/6qipazjA5mdVkzEGVYUzOgOTVFluu9GPJmwrdGhnumeJEB/+VUOE1Shw==} + /@vitest/ui/0.10.5: + resolution: {integrity: sha512-DEj6GbXf98VJfVDszyczYRVKDJEjmAbMKGzt5cOM04dxrKfqb8ZM19WJJJCFyBOXmq1wrRKEXZ5LA293Mc57Nw==} dependencies: sirv: 2.0.2 dev: true @@ -2494,6 +2496,18 @@ packages: path-is-absolute: 1.0.1 dev: true + /glob/8.0.1: + resolution: {integrity: sha512-cF7FYZZ47YzmCu7dDy50xSRRfO3ErRfrXuLZcNIuyiJEco0XSrGtuilG19L5xp3NcwTx7Gn+X6Tv3fmsUPTbow==} + engines: {node: '>=12'} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.0.1 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + /global-dirs/3.0.0: resolution: {integrity: sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==} engines: {node: '>=10'} @@ -4514,8 +4528,8 @@ packages: - stylus dev: true - /vitest/0.10.2_psihcmhmrlrkhevakbcy5k6nlu: - resolution: {integrity: sha512-41D+nhswCco5vy1NXmpAjZX11Aj+HMnyhjWQD12piwHibf4bvdTGtni56UcFWcvONVoIForgDuLrKSohHJjwQA==} + /vitest/0.10.5_2jfoe7rfkpxojpgvnil25xksju: + resolution: {integrity: sha512-4qXdNbHwAd9YcsztJoVMWUQGcMATVlY9Xd95I3KQ2JJwDLTL97f/jgfGRotqptvNxdlmme5TBY0Gv+l6+JSYvA==} engines: {node: '>=v14.16.0'} hasBin: true peerDependencies: @@ -4535,7 +4549,7 @@ packages: dependencies: '@types/chai': 4.3.1 '@types/chai-subset': 1.3.3 - '@vitest/ui': 0.10.2 + '@vitest/ui': 0.10.5 c8: 7.11.2 chai: 4.3.6 local-pkg: 0.4.1 diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000000..57660233ffc --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ESNext", + "moduleResolution": "Node", + "module": "ESNext", + "noEmit": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "alwaysStrict": true, + // "strictNullChecks": true, + // "strictBindCallApply": true, + "strictFunctionTypes": true, + // "strictPropertyInitialization": true, + // "noImplicitAny": true, + // "noImplicitThis": true, + "useUnknownInCatchVariables": true + }, + "exclude": ["node_modules"] +} diff --git a/tsconfig.check-scripts.json b/tsconfig.check-scripts.json new file mode 100644 index 00000000000..5a6511a094f --- /dev/null +++ b/tsconfig.check-scripts.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.base.json", + "include": ["scripts/**/*.ts"] +} diff --git a/tsconfig.check-tests.json b/tsconfig.check-tests.json new file mode 100644 index 00000000000..206022c4160 --- /dev/null +++ b/tsconfig.check-tests.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.base.json", + "include": ["test/**/*.ts"] +} diff --git a/tsconfig.lint.json b/tsconfig.lint.json index 362d4c3e057..e31e38827df 100644 --- a/tsconfig.lint.json +++ b/tsconfig.lint.json @@ -1,21 +1,9 @@ { + "extends": "./tsconfig.base.json", "compilerOptions": { "target": "ES2020", - "moduleResolution": "Node", - "esModuleInterop": true, - "allowJs": true, - "alwaysStrict": true, - // "strictNullChecks": true, - // "strictBindCallApply": true, - "strictFunctionTypes": true, - // "strictPropertyInitialization": true, - // "noImplicitAny": true, - // "noImplicitThis": true, - "useUnknownInCatchVariables": true, "stripInternal": true, - - "rootDir": ".", - "noEmit": true - }, - "exclude": ["node_modules"] + "skipLibCheck": false, + "rootDir": "." + } }