From cc242d3af2cc39731cc40b07ac0aa1db687b2920 Mon Sep 17 00:00:00 2001 From: Erika <3019731+Princesseuh@users.noreply.github.com> Date: Thu, 8 Sep 2022 16:31:54 -0300 Subject: [PATCH] Fix TypeScript compilation errors (#4683) * Fix TypeScript compilation errors * Update lockfile * Add changeset --- .changeset/ninety-donuts-hunt.md | 5 +++++ packages/astro/package.json | 6 +++--- packages/astro/src/@types/astro.ts | 7 +++++-- pnpm-lock.yaml | 15 ++++++--------- 4 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 .changeset/ninety-donuts-hunt.md diff --git a/.changeset/ninety-donuts-hunt.md b/.changeset/ninety-donuts-hunt.md new file mode 100644 index 000000000000..74255f63f1b4 --- /dev/null +++ b/.changeset/ninety-donuts-hunt.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix `tsc` compilation errors when `skipLibCheck` wasn't enabled diff --git a/packages/astro/package.json b/packages/astro/package.json index 82c848ad37bb..5428882c488d 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -107,6 +107,9 @@ "@babel/types": "^7.18.4", "@proload/core": "^0.3.2", "@proload/plugin-tsm": "^0.2.1", + "@types/babel__core": "^7.1.19", + "@types/html-escaper": "^3.0.0", + "@types/yargs-parser": "^21.0.0", "boxen": "^6.2.1", "ci-info": "^3.3.1", "common-ancestor-path": "^1.0.1", @@ -151,7 +154,6 @@ }, "devDependencies": { "@playwright/test": "^1.22.2", - "@types/babel__core": "^7.1.19", "@types/babel__generator": "^7.6.4", "@types/babel__traverse": "^7.17.1", "@types/chai": "^4.3.1", @@ -160,7 +162,6 @@ "@types/debug": "^4.1.7", "@types/diff": "^5.0.2", "@types/estree": "^0.0.51", - "@types/html-escaper": "^3.0.0", "@types/mime": "^2.0.3", "@types/mocha": "^9.1.1", "@types/parse5": "^6.0.3", @@ -170,7 +171,6 @@ "@types/rimraf": "^3.0.2", "@types/send": "^0.17.1", "@types/unist": "^2.0.6", - "@types/yargs-parser": "^21.0.0", "ast-types": "^0.14.2", "astro-scripts": "workspace:*", "chai": "^4.3.6", diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 5cd7abe241e6..b2347c410626 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -924,7 +924,7 @@ export interface MarkdownInstance> { default: AstroComponentFactory; } -export interface MDXInstance +export interface MDXInstance> extends Omit, 'rawContent' | 'compiledContent'> { /** MDX does not support rawContent! If you need to read the Markdown contents to calculate values (ex. reading time), we suggest injecting frontmatter via remark plugins. Learn more on our docs: https://docs.astro.build/en/guides/integrations-guide/mdx/#inject-frontmatter-via-remark-or-rehype-plugins */ rawContent: never; @@ -944,7 +944,10 @@ export interface MarkdownLayoutProps> { compiledContent: MarkdownInstance['compiledContent']; } -export type MDXLayoutProps = Omit, 'rawContent' | 'compiledContent'>; +export type MDXLayoutProps> = Omit< + MarkdownLayoutProps, + 'rawContent' | 'compiledContent' +>; export type GetHydrateCallback = () => Promise<() => void | Promise>; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 145e451c993c..e67cd1546b9e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -434,6 +434,9 @@ importers: '@babel/types': 7.19.0 '@proload/core': 0.3.3 '@proload/plugin-tsm': 0.2.1_@proload+core@0.3.3 + '@types/babel__core': 7.1.19 + '@types/html-escaper': 3.0.0 + '@types/yargs-parser': 21.0.0 boxen: 6.2.1 ci-info: 3.3.2 common-ancestor-path: 1.0.1 @@ -477,7 +480,6 @@ importers: zod: 3.19.0 devDependencies: '@playwright/test': 1.25.2 - '@types/babel__core': 7.1.19 '@types/babel__generator': 7.6.4 '@types/babel__traverse': 7.18.1 '@types/chai': 4.3.3 @@ -486,7 +488,6 @@ importers: '@types/debug': 4.1.7 '@types/diff': 5.0.2 '@types/estree': 0.0.51 - '@types/html-escaper': 3.0.0 '@types/mime': 2.0.3 '@types/mocha': 9.1.1 '@types/parse5': 6.0.3 @@ -496,7 +497,6 @@ importers: '@types/rimraf': 3.0.2 '@types/send': 0.17.1 '@types/unist': 2.0.6 - '@types/yargs-parser': 21.0.0 ast-types: 0.14.2 astro-scripts: link:../../scripts chai: 4.3.6 @@ -8818,26 +8818,24 @@ packages: '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 '@types/babel__traverse': 7.18.1 - dev: true + dev: false /@types/babel__generator/7.6.4: resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} dependencies: '@babel/types': 7.19.0 - dev: true /@types/babel__template/7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: '@babel/parser': 7.19.0 '@babel/types': 7.19.0 - dev: true + dev: false /@types/babel__traverse/7.18.1: resolution: {integrity: sha512-FSdLaZh2UxaMuLp9lixWaHq/golWTRWOnRsAXzDTDSDOQLuZb1nsdCt6pJSPWSEQt2eFZ2YVk3oYhn+1kLMeMA==} dependencies: '@babel/types': 7.19.0 - dev: true /@types/chai-as-promised/7.1.5: resolution: {integrity: sha512-jStwss93SITGBwt/niYrkf2C+/1KTeZCZl1LaeezTlqppAKeoQC7jxyqYuP72sxBGKCIbw7oHgbYssIRzT5FCQ==} @@ -8926,7 +8924,7 @@ packages: /@types/html-escaper/3.0.0: resolution: {integrity: sha512-OcJcvP3Yk8mjYwf/IdXZtTE1tb/u0WF0qa29ER07ZHCYUBZXSN29Z1mBS+/96+kNMGTFUAbSz9X+pHmHpZrTCw==} - dev: true + dev: false /@types/is-ci/3.0.0: resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} @@ -9137,7 +9135,6 @@ packages: /@types/yargs-parser/21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} - dev: true /@typescript-eslint/eslint-plugin/5.36.2_kou65mzxaniwtkb2mhvaghdcyi: resolution: {integrity: sha512-OwwR8LRwSnI98tdc2z7mJYgY60gf7I9ZfGjN5EjCwwns9bdTuQfAXcsjSB2wSQ/TVNYSGKf4kzVXbNGaZvwiXw==}