From 30e639f94d8642d855806900eea89645ddd2653a Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Tue, 19 Mar 2024 22:30:41 +0100 Subject: [PATCH 01/19] Add basic ESLint configuration and `lint` script --- .eslintignore | 4 + .eslintrc.js | 68 ++++++ package.json | 8 +- pnpm-lock.yaml | 554 +++++++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 618 insertions(+), 16 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000000..e14bbdedd87 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +dist +node_modules +.github +.changeset diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000000..73a125cd840 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,68 @@ +module.exports = { + root: true, + extends: ['eslint:recommended'], + plugins: ['no-only-tests'], + env: { + browser: true, + node: true, + }, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + tsconfigRootDir: __dirname, + project: ['./tsconfig.json', './docs/tsconfig.json'], + }, + ignorePatterns: ['**/node_modules/*', '**/dist/*'], + rules: { + 'no-only-tests/no-only-tests': 'warn', + 'no-empty': 'warn', + 'no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^(_.*?|e)$', + }, + ], + 'no-unused-private-class-members': 'warn', + 'no-invalid-this': 'warn', + 'consistent-this': 'warn', + 'no-mixed-spaces-and-tabs': 'off', + }, + overrides: [ + { + files: ['**/*.ts'], + parser: '@typescript-eslint/parser', + extends: [ + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + ], + rules: { + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + destructuredArrayIgnorePattern: '^_', + varsIgnorePattern: '^_', + }, + ], + '@typescript-eslint/no-empty-function': 'warn', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-redundant-type-constituents': 'off', + }, + }, + { + files: ['**/env.d.ts'], + rules: { + '@typescript-eslint/triple-slash-reference': 'off', + }, + }, + { + files: ['packages/*/__tests__/**/*.ts'], + rules: { + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-empty-function': 'off', + }, + }, + ], +}; diff --git a/package.json b/package.json index e0609e2ae0e..31aa7547507 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "description": "", "scripts": { "build:examples": "pnpm --no-bail --workspace-concurrency 1 --filter '@example/*' build", + "lint": "eslint .", "size": "size-limit", "version": "pnpm changeset version && pnpm i --no-frozen-lockfile", "format": "prettier -w --cache --plugin prettier-plugin-astro ." @@ -14,10 +15,15 @@ "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.26.1", "@size-limit/file": "^8.2.4", + "@typescript-eslint/eslint-plugin": "^7.3.1", + "@typescript-eslint/parser": "^7.3.1", "astro": "^4.3.5", + "eslint": "^8.53.0", + "eslint-plugin-no-only-tests": "^3.1.0", "prettier": "^3.0.0", "prettier-plugin-astro": "^0.13.0", - "size-limit": "^8.2.4" + "size-limit": "^8.2.4", + "typescript": "^5.4.2" }, "packageManager": "pnpm@8.7.4", "size-limit": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3c0797e9483..f5ce5090d84 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,9 +17,21 @@ importers: '@size-limit/file': specifier: ^8.2.4 version: 8.2.4(size-limit@8.2.4) + '@typescript-eslint/eslint-plugin': + specifier: ^7.3.1 + version: 7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': + specifier: ^7.3.1 + version: 7.3.1(eslint@8.57.0)(typescript@5.4.2) astro: specifier: ^4.3.5 - version: 4.3.5(@types/node@18.16.19) + version: 4.3.5(@types/node@18.16.19)(typescript@5.4.2) + eslint: + specifier: ^8.53.0 + version: 8.57.0 + eslint-plugin-no-only-tests: + specifier: ^3.1.0 + version: 3.1.0 prettier: specifier: ^3.0.0 version: 3.0.0 @@ -29,6 +41,9 @@ importers: size-limit: specifier: ^8.2.4 version: 8.2.4 + typescript: + specifier: ^5.4.2 + version: 5.4.2 docs: dependencies: @@ -46,7 +61,7 @@ importers: version: 2.0.0 astro: specifier: ^4.3.5 - version: 4.3.5(@types/node@18.16.19) + version: 4.3.5(@types/node@18.16.19)(typescript@5.4.2) culori: specifier: ^3.2.0 version: 3.2.0 @@ -71,7 +86,7 @@ importers: version: link:../../packages/starlight astro: specifier: ^4.3.5 - version: 4.3.5(@types/node@18.16.19) + version: 4.3.5(@types/node@18.16.19)(typescript@5.4.2) sharp: specifier: ^0.32.5 version: 0.32.6 @@ -89,7 +104,7 @@ importers: version: 5.1.0(astro@4.3.5)(tailwindcss@3.4.1) astro: specifier: ^4.3.5 - version: 4.3.5(@types/node@18.16.19) + version: 4.3.5(@types/node@18.16.19)(typescript@5.4.2) sharp: specifier: ^0.32.5 version: 0.32.6 @@ -196,7 +211,7 @@ importers: version: 1.3.1(vitest@1.3.1) astro: specifier: ^4.3.5 - version: 4.3.5(@types/node@18.16.19) + version: 4.3.5(@types/node@18.16.19)(typescript@5.4.2) vitest: specifier: ^1.3.1 version: 1.3.1(@types/node@18.16.19) @@ -225,6 +240,11 @@ importers: packages: + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + dev: true + /@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.11.0): resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} dependencies: @@ -376,7 +396,7 @@ packages: peerDependencies: astro: ^2.0.0 || ^3.0.0-beta || ^4.0.0-beta dependencies: - astro: 4.3.5(@types/node@18.16.19) + astro: 4.3.5(@types/node@18.16.19)(typescript@5.4.2) lite-youtube-embed: 0.2.0 dev: false @@ -419,7 +439,7 @@ packages: '@astrojs/markdown-remark': 4.2.1 '@mdx-js/mdx': 3.0.0 acorn: 8.11.3 - astro: 4.3.5(@types/node@18.16.19) + astro: 4.3.5(@types/node@18.16.19)(typescript@5.4.2) es-module-lexer: 1.4.1 estree-util-visit: 2.0.0 github-slugger: 2.0.0 @@ -455,7 +475,7 @@ packages: astro: ^3.0.0 || ^4.0.0 tailwindcss: ^3.0.24 dependencies: - astro: 4.3.5(@types/node@18.16.19) + astro: 4.3.5(@types/node@18.16.19)(typescript@5.4.2) autoprefixer: 10.4.15(postcss@8.4.33) postcss: 8.4.33 postcss-load-config: 4.0.2(postcss@8.4.33) @@ -1325,6 +1345,43 @@ packages: requiresBuild: true optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.57.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/regexpp@4.10.0: + resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + + /@eslint/eslintrc@2.1.4: + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.2.4 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/js@8.57.0: + resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /@expressive-code/core@0.33.4: resolution: {integrity: sha512-IywACrwcR/7cIPBQ1qG/RsgvNp85/CAX6okxR0Niztrd7rh4IcEhAsz51jX/NPNnhU9yPynTT+mLdM1URqrnvw==} dependencies: @@ -1367,6 +1424,26 @@ packages: '@hapi/hoek': 9.3.0 dev: true + /@humanwhocodes/config-array@0.11.14: + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': 2.0.2 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@humanwhocodes/module-importer@1.0.1: + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + dev: true + + /@humanwhocodes/object-schema@2.0.2: + resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} + dev: true + /@istanbuljs/schema@0.1.3: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} @@ -1779,6 +1856,10 @@ packages: resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} dev: true + /@types/json-schema@7.0.15: + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + dev: true + /@types/mdast@4.0.3: resolution: {integrity: sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==} dependencies: @@ -1838,6 +1919,10 @@ packages: resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} dev: true + /@types/semver@7.5.8: + resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} + dev: true + /@types/trusted-types@2.0.7: resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} dev: false @@ -1856,6 +1941,138 @@ packages: dev: true optional: true + /@typescript-eslint/eslint-plugin@7.3.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.10.0 + '@typescript-eslint/parser': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/scope-manager': 7.3.1 + '@typescript-eslint/type-utils': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/utils': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 7.3.1 + debug: 4.3.4 + eslint: 8.57.0 + graphemer: 1.4.0 + ignore: 5.2.4 + natural-compare: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.3.0(typescript@5.4.2) + typescript: 5.4.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/parser@7.3.1(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 7.3.1 + '@typescript-eslint/types': 7.3.1 + '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 7.3.1 + debug: 4.3.4 + eslint: 8.57.0 + typescript: 5.4.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/scope-manager@7.3.1: + resolution: {integrity: sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.3.1 + '@typescript-eslint/visitor-keys': 7.3.1 + dev: true + + /@typescript-eslint/type-utils@7.3.1(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.4.2) + '@typescript-eslint/utils': 7.3.1(eslint@8.57.0)(typescript@5.4.2) + debug: 4.3.4 + eslint: 8.57.0 + ts-api-utils: 1.3.0(typescript@5.4.2) + typescript: 5.4.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/types@7.3.1: + resolution: {integrity: sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==} + engines: {node: ^18.18.0 || >=20.0.0} + dev: true + + /@typescript-eslint/typescript-estree@7.3.1(typescript@5.4.2): + resolution: {integrity: sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 7.3.1 + '@typescript-eslint/visitor-keys': 7.3.1 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.5.4 + ts-api-utils: 1.3.0(typescript@5.4.2) + typescript: 5.4.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils@7.3.1(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.8 + '@typescript-eslint/scope-manager': 7.3.1 + '@typescript-eslint/types': 7.3.1 + '@typescript-eslint/typescript-estree': 7.3.1(typescript@5.4.2) + eslint: 8.57.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys@7.3.1: + resolution: {integrity: sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.3.1 + eslint-visitor-keys: 3.4.3 + dev: true + /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -1931,7 +2148,6 @@ packages: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: acorn: 8.11.3 - dev: false /acorn-walk@8.3.2: resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} @@ -1952,6 +2168,15 @@ packages: - supports-color dev: true + /ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: true + /algoliasearch@4.20.0: resolution: {integrity: sha512-y+UHEjnOItoNy0bYO+WWmLWBlPwDjKHW6mNHrPi0NkuhpQOOEbrkwQH/wgKFDLh7qlKjzoKeiRtlpewDPDG23g==} dependencies: @@ -2094,12 +2319,12 @@ packages: peerDependencies: astro: ^3.3.0 || ^4.0.0-beta dependencies: - astro: 4.3.5(@types/node@18.16.19) + astro: 4.3.5(@types/node@18.16.19)(typescript@5.4.2) hast-util-to-html: 8.0.4 remark-expressive-code: 0.33.4 dev: false - /astro@4.3.5(@types/node@18.16.19): + /astro@4.3.5(@types/node@18.16.19)(typescript@5.4.2): resolution: {integrity: sha512-7jPffNlcmDO94NlkWe/hUWta/pIjlx1LVD/DZb/fyjT1Jv+7mGhKZBIjkDfeVpequW70mep8cAS5RM7Pxa0Gdg==} engines: {node: '>=18.14.1', npm: '>=6.14.0'} hasBin: true @@ -2160,7 +2385,7 @@ packages: shikiji: 0.9.19 string-width: 7.0.0 strip-ansi: 7.1.0 - tsconfck: 3.0.0 + tsconfck: 3.0.0(typescript@5.4.2) unist-util-visit: 5.0.0 vfile: 6.0.1 vite: 5.0.12(@types/node@18.16.19) @@ -2319,6 +2544,12 @@ packages: balanced-match: 1.0.2 concat-map: 0.0.1 + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -2374,6 +2605,11 @@ packages: get-intrinsic: 1.2.0 dev: true + /callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + /camelcase-css@2.0.1: resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} engines: {node: '>= 6'} @@ -2771,6 +3007,10 @@ packages: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} + /deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: true + /defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} dependencies: @@ -2849,6 +3089,13 @@ packages: /dlv@1.1.3: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} + /doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dependencies: + esutils: 2.0.3 + dev: true + /dom-serializer@2.0.0: resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} dependencies: @@ -3075,15 +3322,113 @@ packages: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} + /escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + dev: true + /escape-string-regexp@5.0.0: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} + /eslint-plugin-no-only-tests@3.1.0: + resolution: {integrity: sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==} + engines: {node: '>=5.0.0'} + dev: true + + /eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /eslint@8.57.0: + resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/regexpp': 4.10.0 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.57.0 + '@humanwhocodes/config-array': 0.11.14 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.2.4 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.3 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.11.3 + acorn-jsx: 5.3.2(acorn@8.11.3) + eslint-visitor-keys: 3.4.3 + dev: true + /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true + /esquery@1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + + /esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: true + + /estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: true + /estree-util-attach-comments@3.0.0: resolution: {integrity: sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==} dependencies: @@ -3123,6 +3468,11 @@ packages: dependencies: '@types/estree': 1.0.0 + /esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + /event-stream@3.3.4: resolution: {integrity: sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==} dependencies: @@ -3216,6 +3566,10 @@ packages: - supports-color dev: true + /fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: true + /fast-fifo@1.3.0: resolution: {integrity: sha512-IgfweLvEpwyA4WgiQe9Nx6VV2QkML2NkvZnk1oKnIzXgXdWxuhF7zw4DvLTPZJn6PIUneiAXPF24QmoEqHTjyw==} @@ -3229,6 +3583,14 @@ packages: merge2: 1.4.1 micromatch: 4.0.5 + /fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + + /fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: true + /fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: @@ -3248,6 +3610,13 @@ packages: web-streams-polyfill: 3.2.1 dev: false + /file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flat-cache: 3.2.0 + dev: true + /file-url@3.0.0: resolution: {integrity: sha512-g872QGsHexznxkIAdK8UiZRe7SkE6kvylShU4Nsj8NvfvZag7S0QuQ4IgvPDkk75HxgjIVDwycFTDAgIiO4nDA==} engines: {node: '>=8'} @@ -3279,6 +3648,19 @@ packages: micromatch: 4.0.5 pkg-dir: 4.2.0 + /flat-cache@3.2.0: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flatted: 3.3.1 + keyv: 4.5.4 + rimraf: 3.0.2 + dev: true + + /flatted@3.3.1: + resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + dev: true + /flattie@1.1.0: resolution: {integrity: sha512-xU99gDEnciIwJdGcBmNHnzTJ/w5AT+VFJOu6sTB6WM8diOYNA3Sa+K1DiEBQ7XH4QikQq3iFW1U+jRVcotQnBw==} engines: {node: '>=8'} @@ -3445,7 +3827,6 @@ packages: engines: {node: '>=10.13.0'} dependencies: is-glob: 4.0.3 - dev: false /glob@7.1.6: resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} @@ -3473,6 +3854,13 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} + /globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + dev: true + /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} @@ -3516,6 +3904,10 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true + /gray-matter@4.0.3: resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==} engines: {node: '>=6.0'} @@ -3934,9 +4326,22 @@ packages: engines: {node: '>= 4'} dev: true + /import-fresh@3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + /import-meta-resolve@4.0.0: resolution: {integrity: sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==} + /imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: true + /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} @@ -4113,6 +4518,11 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + /is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + dev: true + /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} @@ -4284,10 +4694,22 @@ packages: engines: {node: '>=4'} hasBin: true + /json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true + /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: true + /json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + dev: true + + /json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: true + /json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -4303,6 +4725,12 @@ packages: graceful-fs: 4.2.10 dev: true + /keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + dependencies: + json-buffer: 3.0.1 + dev: true + /kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} @@ -4320,6 +4748,14 @@ packages: engines: {node: '> 0.8'} dev: true + /levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} @@ -5066,6 +5502,13 @@ packages: dependencies: brace-expansion: 1.1.11 + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist-options@4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} @@ -5128,6 +5571,10 @@ packages: /napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} + /natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + /needle@2.9.1: resolution: {integrity: sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==} engines: {node: '>= 4.4.x'} @@ -5291,6 +5738,18 @@ packages: tiny-inflate: 1.0.3 dev: false + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} + engines: {node: '>= 0.8.0'} + dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + /ora@7.0.1: resolution: {integrity: sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==} engines: {node: '>=16'} @@ -5433,6 +5892,13 @@ packages: '@pagefind/windows-x64': 1.0.3 dev: false + /parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + dev: true + /parse-entities@4.0.1: resolution: {integrity: sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==} dependencies: @@ -5678,6 +6144,11 @@ packages: path-exists: 4.0.0 which-pm: 2.0.0 + /prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + dev: true + /prepend-http@3.0.1: resolution: {integrity: sha512-BLxfZh+m6UiAiCPZFJ4+vYoL7NrRs5XgCTRrjseATAggXhdZKKxn+JUNmuVYWY23bDHgaEHodxw8mnmtVEDtHw==} engines: {node: '>=8'} @@ -5771,6 +6242,11 @@ packages: end-of-stream: 1.4.4 once: 1.4.0 + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + dev: true + /puppeteer@9.1.1: resolution: {integrity: sha512-W+nOulP2tYd/ZG99WuZC/I5ljjQQ7EUw/jQGcIb9eu8mDlZxNY2SgcJXTLG9h5gRvqA3uJOe4hZXYsd3EqioMw==} engines: {node: '>=10.18.1'} @@ -6033,6 +6509,11 @@ packages: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} dev: true + /resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + dev: true + /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -6404,7 +6885,7 @@ packages: astro: '>=4.0.0' dependencies: '@astrojs/starlight': link:packages/starlight - astro: 4.3.5(@types/node@18.16.19) + astro: 4.3.5(@types/node@18.16.19)(typescript@5.4.2) github-slugger: 2.0.0 hast-util-from-html: 2.0.1 hast-util-has-property: 3.0.0 @@ -6585,6 +7066,11 @@ packages: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} + /strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true + /strip-literal@2.0.0: resolution: {integrity: sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==} dependencies: @@ -6722,6 +7208,10 @@ packages: minimatch: 3.1.2 dev: true + /text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + dev: true + /thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -6793,11 +7283,20 @@ packages: resolution: {integrity: sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==} dev: true + /ts-api-utils@1.3.0(typescript@5.4.2): + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.4.2 + dev: true + /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: false - /tsconfck@3.0.0: + /tsconfck@3.0.0(typescript@5.4.2): resolution: {integrity: sha512-w3wnsIrJNi7avf4Zb0VjOoodoO0woEqGgZGQm+LHH9przdUI+XDKsWAXwxHA1DaRTjeuZNcregSzr7RaA8zG9A==} engines: {node: ^18 || >=20} hasBin: true @@ -6806,6 +7305,8 @@ packages: peerDependenciesMeta: typescript: optional: true + dependencies: + typescript: 5.4.2 /tslib@2.5.0: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} @@ -6841,6 +7342,13 @@ packages: dependencies: safe-buffer: 5.2.1 + /type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + dev: true + /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} @@ -6851,6 +7359,11 @@ packages: engines: {node: '>=10'} dev: true + /type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + dev: true + /type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} @@ -6873,6 +7386,11 @@ packages: is-typed-array: 1.1.10 dev: true + /typescript@5.4.2: + resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} + engines: {node: '>=14.17'} + hasBin: true + /ufo@1.3.2: resolution: {integrity: sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==} @@ -7025,6 +7543,12 @@ packages: escalade: 3.1.1 picocolors: 1.0.0 + /uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.3.1 + dev: true + /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} From 706d1fa7abce1bf4ce9715b38afc821e1e543b83 Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Wed, 20 Mar 2024 11:38:44 +0100 Subject: [PATCH 02/19] Trim down ESLint config --- .eslintrc.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 73a125cd840..01986d99d8d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,26 +15,13 @@ module.exports = { ignorePatterns: ['**/node_modules/*', '**/dist/*'], rules: { 'no-only-tests/no-only-tests': 'warn', - 'no-empty': 'warn', - 'no-unused-vars': [ - 'warn', - { - argsIgnorePattern: '^(_.*?|e)$', - }, - ], - 'no-unused-private-class-members': 'warn', - 'no-invalid-this': 'warn', - 'consistent-this': 'warn', 'no-mixed-spaces-and-tabs': 'off', }, overrides: [ { files: ['**/*.ts'], parser: '@typescript-eslint/parser', - extends: [ - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', - ], + extends: ['plugin:@typescript-eslint/recommended-type-checked'], rules: { '@typescript-eslint/no-unused-vars': [ 'warn', @@ -44,7 +31,6 @@ module.exports = { varsIgnorePattern: '^_', }, ], - '@typescript-eslint/no-empty-function': 'warn', '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-redundant-type-constituents': 'off', }, From 403934f4cf91b101e03ebec83bd29acef9d202be Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:02:52 +0100 Subject: [PATCH 03/19] Add lint job to CI workflow --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ package.json | 1 + 2 files changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbde0027a03..de9fb9d79a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,26 @@ jobs: - name: Test packages run: pnpm -r test:coverage + lint: + name: Lint code + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'pnpm' + - run: pnpm i + - name: Run linter + run: pnpm lint:ci + # Continue on errors because we use the generated report in the next step + continue-on-error: true + - name: Annotate lint results + uses: ataylorme/eslint-annotate-action@v2 + with: + report-json: "eslint-report.json" + pa11y: name: Check for accessibility issues runs-on: ubuntu-20.04 diff --git a/package.json b/package.json index 31aa7547507..cb289c3bae7 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "build:examples": "pnpm --no-bail --workspace-concurrency 1 --filter '@example/*' build", "lint": "eslint .", + "lint:ci": "eslint . --max-warnings 0 --output-file eslint-report.json --format json", "size": "size-limit", "version": "pnpm changeset version && pnpm i --no-frozen-lockfile", "format": "prettier -w --cache --plugin prettier-plugin-astro ." From d4abfef7425d1b623e0790f9c64f1dadb93c4f45 Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:27:00 +0100 Subject: [PATCH 04/19] Remove annotation action that doesn't work on fork PRs --- .github/workflows/ci.yml | 6 ------ package.json | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de9fb9d79a6..e268085fe71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,12 +43,6 @@ jobs: - run: pnpm i - name: Run linter run: pnpm lint:ci - # Continue on errors because we use the generated report in the next step - continue-on-error: true - - name: Annotate lint results - uses: ataylorme/eslint-annotate-action@v2 - with: - report-json: "eslint-report.json" pa11y: name: Check for accessibility issues diff --git a/package.json b/package.json index cb289c3bae7..3671d8a5b75 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "build:examples": "pnpm --no-bail --workspace-concurrency 1 --filter '@example/*' build", "lint": "eslint .", - "lint:ci": "eslint . --max-warnings 0 --output-file eslint-report.json --format json", + "lint:ci": "eslint . --max-warnings 0", "size": "size-limit", "version": "pnpm changeset version && pnpm i --no-frozen-lockfile", "format": "prettier -w --cache --plugin prettier-plugin-astro ." From 4a4fab69103d928ccadc02c49092b855ec2a0a15 Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:02:17 +0100 Subject: [PATCH 05/19] Generate Astro types before linting --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e268085fe71..b21705ce70d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,9 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: 'pnpm' - run: pnpm i + - name: Generate types + working-directory: ./docs + run: pnpm astro sync - name: Run linter run: pnpm lint:ci From b0417ac4e88a549203980d9f149bc15f303ef112 Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:37:27 +0100 Subject: [PATCH 06/19] Apply suggestions from code review --- .eslintrc.js => .eslintrc.cjs | 7 +------ package.json | 1 + pnpm-lock.yaml | 12 ++++++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) rename .eslintrc.js => .eslintrc.cjs (78%) diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 78% rename from .eslintrc.js rename to .eslintrc.cjs index 01986d99d8d..f0fc6d5928a 100644 --- a/.eslintrc.js +++ b/.eslintrc.cjs @@ -1,6 +1,6 @@ module.exports = { root: true, - extends: ['eslint:recommended'], + extends: ['eslint:recommended', 'prettier'], plugins: ['no-only-tests'], env: { browser: true, @@ -12,10 +12,8 @@ module.exports = { tsconfigRootDir: __dirname, project: ['./tsconfig.json', './docs/tsconfig.json'], }, - ignorePatterns: ['**/node_modules/*', '**/dist/*'], rules: { 'no-only-tests/no-only-tests': 'warn', - 'no-mixed-spaces-and-tabs': 'off', }, overrides: [ { @@ -31,8 +29,6 @@ module.exports = { varsIgnorePattern: '^_', }, ], - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-redundant-type-constituents': 'off', }, }, { @@ -47,7 +43,6 @@ module.exports = { '@typescript-eslint/no-unsafe-argument': 'off', '@typescript-eslint/no-unsafe-assignment': 'off', '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-empty-function': 'off', }, }, ], diff --git a/package.json b/package.json index 3671d8a5b75..f98a4fd98e0 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@typescript-eslint/parser": "^7.3.1", "astro": "^4.3.5", "eslint": "^8.53.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-no-only-tests": "^3.1.0", "prettier": "^3.0.0", "prettier-plugin-astro": "^0.13.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f5ce5090d84..585bc1c591e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: eslint: specifier: ^8.53.0 version: 8.57.0 + eslint-config-prettier: + specifier: ^9.1.0 + version: 9.1.0(eslint@8.57.0) eslint-plugin-no-only-tests: specifier: ^3.1.0 version: 3.1.0 @@ -3331,6 +3334,15 @@ packages: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} + /eslint-config-prettier@9.1.0(eslint@8.57.0): + resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: 8.57.0 + dev: true + /eslint-plugin-no-only-tests@3.1.0: resolution: {integrity: sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==} engines: {node: '>=5.0.0'} From d1d6aa1a9b10c2098d895b4fbe72ce1e17c0f0b4 Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:41:50 +0100 Subject: [PATCH 07/19] Combine lint scripts into a single one --- .github/workflows/ci.yml | 2 +- package.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b21705ce70d..fbca595eb4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: working-directory: ./docs run: pnpm astro sync - name: Run linter - run: pnpm lint:ci + run: pnpm lint pa11y: name: Check for accessibility issues diff --git a/package.json b/package.json index f98a4fd98e0..cdc5518a21d 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,7 @@ "description": "", "scripts": { "build:examples": "pnpm --no-bail --workspace-concurrency 1 --filter '@example/*' build", - "lint": "eslint .", - "lint:ci": "eslint . --max-warnings 0", + "lint": "eslint . --max-warnings 0", "size": "size-limit", "version": "pnpm changeset version && pnpm i --no-frozen-lockfile", "format": "prettier -w --cache --plugin prettier-plugin-astro ." From ea5bead1f3b1467494a1f15737e6f2da79a30f4c Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:58:37 +0100 Subject: [PATCH 08/19] Remove test case exceptions for using `any` --- .eslintrc.cjs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index f0fc6d5928a..ed729220b11 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -37,13 +37,5 @@ module.exports = { '@typescript-eslint/triple-slash-reference': 'off', }, }, - { - files: ['packages/*/__tests__/**/*.ts'], - rules: { - '@typescript-eslint/no-unsafe-argument': 'off', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-explicit-any': 'off', - }, - }, ], }; From ecdf100e6150a3772d98c009b5f2fcfe16e6b442 Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:32:22 +0100 Subject: [PATCH 09/19] Fix tests failing on Windows --- packages/starlight/__tests__/basics/git.test.ts | 4 ++-- packages/starlight/__tests__/i18n-root-locale/routing.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/starlight/__tests__/basics/git.test.ts b/packages/starlight/__tests__/basics/git.test.ts index 1f194f285c7..3865d4820f6 100644 --- a/packages/starlight/__tests__/basics/git.test.ts +++ b/packages/starlight/__tests__/basics/git.test.ts @@ -56,13 +56,13 @@ describe('getNewestCommitDate', () => { test('throws when failing to retrieve the git history for a file', () => { expect(() => getNewestCommitDate(getFilePath('../not-a-starlight-test-repo/test.md'))).toThrow( - /^Failed to retrieve the git history for file "[/\\-\w ]+\/test\.md"/ + /^Failed to retrieve the git history for file "[/\\:\w -]+[/\\]test\.md"/ ); }); test('throws when trying to get the history of a non-existing or untracked file', () => { const expectedError = - /^Failed to validate the timestamp for file "[/\\-\w ]+\/(?:unknown|untracked)\.md"$/; + /^Failed to validate the timestamp for file "[/\\:\w -]+[/\\](?:unknown|untracked)\.md"$/; writeFile('untracked.md', 'content'); expect(() => getNewestCommitDate(getFilePath('unknown.md'))).toThrow(expectedError); diff --git a/packages/starlight/__tests__/i18n-root-locale/routing.test.ts b/packages/starlight/__tests__/i18n-root-locale/routing.test.ts index c6824349091..d3015c64cbc 100644 --- a/packages/starlight/__tests__/i18n-root-locale/routing.test.ts +++ b/packages/starlight/__tests__/i18n-root-locale/routing.test.ts @@ -81,7 +81,7 @@ test('fallback routes use fallback entry last updated dates', () => { }); expect(getNewestCommitDate).toHaveBeenCalledOnce(); - expect(getNewestCommitDate.mock.lastCall?.[0]).toMatch( + expect(getNewestCommitDate.mock.lastCall?.[0]?.replace(/\\/g, '/')).toMatch( /src\/content\/docs\/guides\/authoring-content.md$/ // ^ no `en/` prefix ); From 2fbc1d94a52b77db567b91cf30b5a43a73c60d3d Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:38:58 +0100 Subject: [PATCH 10/19] Replace `any` in invalid input tests with `@ts-expect-error` --- .../__tests__/basics/config-errors.test.ts | 21 ++++++++++++------- .../starlight/__tests__/basics/i18n.test.ts | 3 ++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/starlight/__tests__/basics/config-errors.test.ts b/packages/starlight/__tests__/basics/config-errors.test.ts index dae9b599b6b..fee5602148f 100644 --- a/packages/starlight/__tests__/basics/config-errors.test.ts +++ b/packages/starlight/__tests__/basics/config-errors.test.ts @@ -74,7 +74,8 @@ test('parses valid config successfully', () => { test('errors if title is missing', () => { expect(() => - parseStarlightConfigWithFriendlyErrors({} as any) + // @ts-expect-error Testing invalid config + parseStarlightConfigWithFriendlyErrors({}) ).toThrowErrorMatchingInlineSnapshot( ` "[AstroUserError]: @@ -87,7 +88,8 @@ test('errors if title is missing', () => { test('errors if title value is not a string', () => { expect(() => - parseStarlightConfigWithFriendlyErrors({ title: 5 } as any) + // @ts-expect-error Testing invalid config + parseStarlightConfigWithFriendlyErrors({ title: 5 }) ).toThrowErrorMatchingInlineSnapshot( ` "[AstroUserError]: @@ -100,7 +102,8 @@ test('errors if title value is not a string', () => { test('errors with bad social icon config', () => { expect(() => - parseStarlightConfigWithFriendlyErrors({ title: 'Test', social: { unknown: '' } as any }) + // @ts-expect-error Testing invalid config + parseStarlightConfigWithFriendlyErrors({ title: 'Test', social: { unknown: '' } }) ).toThrowErrorMatchingInlineSnapshot( ` "[AstroUserError]: @@ -114,7 +117,8 @@ test('errors with bad social icon config', () => { test('errors with bad logo config', () => { expect(() => - parseStarlightConfigWithFriendlyErrors({ title: 'Test', logo: { html: '' } as any }) + // @ts-expect-error Testing invalid config + parseStarlightConfigWithFriendlyErrors({ title: 'Test', logo: { html: '' } }) ).toThrowErrorMatchingInlineSnapshot( ` "[AstroUserError]: @@ -131,7 +135,8 @@ test('errors with bad head config', () => { expect(() => parseStarlightConfigWithFriendlyErrors({ title: 'Test', - head: [{ tag: 'unknown', attrs: { prop: null }, content: 20 } as any], + // @ts-expect-error Testing invalid config + head: [{ tag: 'unknown', attrs: { prop: null }, content: 20 }], }) ).toThrowErrorMatchingInlineSnapshot( ` @@ -150,7 +155,8 @@ test('errors with bad sidebar config', () => { expect(() => parseStarlightConfigWithFriendlyErrors({ title: 'Test', - sidebar: [{ label: 'Example', href: '/' } as any], + // @ts-expect-error Testing invalid config + sidebar: [{ label: 'Example', href: '/' }], }) ).toThrowErrorMatchingInlineSnapshot( ` @@ -173,9 +179,10 @@ test('errors with bad nested sidebar config', () => { label: 'Example', items: [ { label: 'Nested Example 1', link: '/' }, + // @ts-expect-error Testing invalid config { label: 'Nested Example 2', link: true }, ], - } as any, + }, ], }) ).toThrowErrorMatchingInlineSnapshot(` diff --git a/packages/starlight/__tests__/basics/i18n.test.ts b/packages/starlight/__tests__/basics/i18n.test.ts index 1ab6262fa6c..eee73cb0ca9 100644 --- a/packages/starlight/__tests__/basics/i18n.test.ts +++ b/packages/starlight/__tests__/basics/i18n.test.ts @@ -10,6 +10,7 @@ describe('pickLang', () => { }); test('returns undefined for unknown languages', () => { - expect(pickLang(dictionary, 'ar' as any)).toBeUndefined(); + // @ts-expect-error Testing invalid input + expect(pickLang(dictionary, 'ar')).toBeUndefined(); }); }); From b60d261cb69b942c0a1de797b533dd7da8b67aaa Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:47:16 +0100 Subject: [PATCH 11/19] Fix `@typescript-eslint/unbound-method` --- packages/starlight/__tests__/basics/git.test.ts | 6 +++--- packages/starlight/translations/index.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/starlight/__tests__/basics/git.test.ts b/packages/starlight/__tests__/basics/git.test.ts index 3865d4820f6..4847b7bd912 100644 --- a/packages/starlight/__tests__/basics/git.test.ts +++ b/packages/starlight/__tests__/basics/git.test.ts @@ -94,17 +94,17 @@ function makeTestRepo() { return { // The `dateStr` argument should be in the `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` format. - commitAllChanges(message: string, dateStr: ISODate) { + commitAllChanges: (message: string, dateStr: ISODate) => { const date = dateStr.endsWith('Z') ? dateStr : `${dateStr}T00:00:00Z`; runInRepo('git', ['add', '-A']); // This sets both the author and committer dates to the provided date. runInRepo('git', ['commit', '-m', message, '--date', date], { GIT_COMMITTER_DATE: date }); }, - getFilePath(name: string) { + getFilePath: (name: string) => { return join(repoPath, name); }, - writeFile(name: string, content: string) { + writeFile: (name: string, content: string) => { writeFileSync(join(repoPath, name), content); }, }; diff --git a/packages/starlight/translations/index.ts b/packages/starlight/translations/index.ts index d8d831114ed..8664d27f129 100644 --- a/packages/starlight/translations/index.ts +++ b/packages/starlight/translations/index.ts @@ -27,6 +27,7 @@ import hi from './hi.json'; import zhTW from './zh-TW.json'; import pl from './pl.json'; +// eslint-disable-next-line @typescript-eslint/unbound-method const { parse } = builtinI18nSchema(); export default Object.fromEntries( From d993ae37cf53fa481caf5d09708efa87883291a5 Mon Sep 17 00:00:00 2001 From: hippotastic <6137925+hippotastic@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:51:43 +0100 Subject: [PATCH 12/19] Fix missing `await` --- packages/starlight/__tests__/plugins/config.test.ts | 8 ++++---- .../starlight/__tests__/remark-rehype/asides.test.ts | 6 +++--- .../__tests__/remark-rehype/rehype-file-tree.test.ts | 12 ++++++------ packages/tailwind/__tests__/tailwind.test.ts | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/starlight/__tests__/plugins/config.test.ts b/packages/starlight/__tests__/plugins/config.test.ts index 0b866b1dacd..adbab659a37 100644 --- a/packages/starlight/__tests__/plugins/config.test.ts +++ b/packages/starlight/__tests__/plugins/config.test.ts @@ -52,7 +52,7 @@ test('receives the user provided configuration including the plugins list', asyn describe('validation', () => { test('validates starlight configuration before running plugins', async () => { - expect( + await expect( async () => await runPlugins( // @ts-expect-error - invalid sidebar config. @@ -64,7 +64,7 @@ describe('validation', () => { }); test('validates plugins configuration before running them', async () => { - expect( + await expect( async () => await runPlugins( { title: 'Test Docs' }, @@ -76,7 +76,7 @@ describe('validation', () => { }); test('validates configuration updates from plugins do not update the `plugins` config key', async () => { - expect( + await expect( async () => await runPlugins( { title: 'Test Docs' }, @@ -99,7 +99,7 @@ describe('validation', () => { }); test('validates configuration updates from plugins', async () => { - expect( + await expect( async () => await runPlugins( { title: 'Test Docs' }, diff --git a/packages/starlight/__tests__/remark-rehype/asides.test.ts b/packages/starlight/__tests__/remark-rehype/asides.test.ts index ba3548c9531..671c50eb22c 100644 --- a/packages/starlight/__tests__/remark-rehype/asides.test.ts +++ b/packages/starlight/__tests__/remark-rehype/asides.test.ts @@ -32,7 +32,7 @@ test('generates