Skip to content

Conversation

@omonk
Copy link
Contributor

@omonk omonk commented Dec 4, 2025

Description

Change packages/docusaurus-plugin-openapi-docs/src/types.ts to a declaration file.

Motivation and Context

Following on from #1220 we are still not able to run typescript checking across our site due to issues with how the internal types are defined in this package.

I have copied the docusaurus tsconfig from here into our repo https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-tsconfig/tsconfig.json

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Docusaurus",
  "docs": "https://docusaurus.io/docs/typescript-support",
  "compilerOptions": {
    "allowJs": true,
    "esModuleInterop": true,
    "jsx": "preserve",
    "target": "ES2022",
    "lib": ["ES2022", "DOM"],
    "moduleResolution": "bundler",
    "module": "esnext",
    "noEmit": true,
    "paths": {
      "@site/*": ["./*"]
    },
    "skipLibCheck": true
  },
  "include": ["api/", "src/", "scripts/"],
  "exclude": [".docusaurus", "build", "node_modules"]
}

Currently if I attempt to typecheck the repo we are still seeing errors from this package

yarn run tsc:check
node_modules/docusaurus-plugin-openapi-docs/src/types.ts:8:32 - error TS2307: Cannot find module '@docusaurus/plugin-content-docs/src/sidebars/types' or its corresponding type declarations.

8 import { SidebarItemDoc } from "@docusaurus/plugin-content-docs/src/sidebars/types";
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/docusaurus-plugin-openapi-docs/src/types.ts:24:8 - error TS2307: Cannot find module '@docusaurus/plugin-content-docs-types' or its corresponding type declarations.

24 } from "@docusaurus/plugin-content-docs-types";
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

skipLibCheck will only skip .d.ts files. If I change my local node module to .d.ts these errors go away.

How Has This Been Tested?

This repo will still build successfully with these changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@omonk
Copy link
Contributor Author

omonk commented Dec 5, 2025

@sserrata would you be able to take a look at this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant