Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: upgrade to TypeScript 5.3 #560

Merged
merged 4 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,20 @@
"@actions/github": "^4.0.0",
"@crowdin/cli": "^3.9.3",
"@crowdin/crowdin-api-client": "^1.21.1",
"@docusaurus/module-type-aliases": "^2.2.0",
"@docusaurus/types": "^2.1.0",
"@docusaurus/module-type-aliases": "^2.4.3",
"@docusaurus/types": "^2.4.3",
"@electron/docs-parser": "^1.0.1",
"@electron/lint-roller": "^1.11.1",
"@tsconfig/docusaurus": "^1.0.6",
"@tsconfig/docusaurus": "^2.0.3",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^26.0.23",
"@types/mdast": "^3.0.10",
"@types/node": "^18.11.10",
"@types/node-fetch": "^2.6.2",
"@types/semver": "^7.3.13",
"@types/tar-stream": "^2.2.2",
"@types/unist": "^2.0.3",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"del": "^6.0.0",
"esbuild-loader": "^2.15.1",
"eslint": "^8.29.0",
Expand All @@ -104,7 +103,6 @@
"gray-matter": "^4.0.3",
"gunzip-maybe": "^1.4.2",
"husky": "^8.0.0",
"jest": "^26.6.3",
erickzhao marked this conversation as resolved.
Show resolved Hide resolved
"json5": "^2.2.2",
"latest-version": "^5.1.0",
"lint-staged": "^13.2.0",
Expand All @@ -114,9 +112,8 @@
"remark": "^13.0.0",
"remark-gfm": "^1.0.0",
"tar-stream": "^2.2.0",
"ts-jest": "^v26.5.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.4",
"typescript": "5.3.2",
"unist-util-visit-parents": "^3.1.1"
},
"resolutions": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/tasks/create-sidebar.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import fs from 'fs-extra';
import json5 from 'json5';
import globby from 'globby';
import {
import type {
Sidebars,
SidebarItemDoc,
} from '@docusaurus/plugin-content-docs/src/sidebars/types';
} from '@docusaurus/plugin-content-docs/src/sidebars/types.js';
import logger from '@docusaurus/logger';
import prettier from 'prettier';
import path from 'path';
Expand Down
4 changes: 0 additions & 4 deletions src/theme/DocSidebarItem/Link/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import React from 'react';
import clsx from 'clsx';
import { ThemeClassNames } from '@docusaurus/theme-common';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error: TypeScript module resolution requires Node16 here
// but that breaks other type imports in our scripts. Manually tested that
// .`menu__link--active` still applies.
import { isActiveSidebarItem } from '@docusaurus/theme-common/internal';
import Link from '@docusaurus/Link';
import isInternalUrl from '@docusaurus/isInternalUrl';
Expand Down
15 changes: 10 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"extends": "@tsconfig/docusaurus/tsconfig.json",
"extends": "./node_modules/@tsconfig/docusaurus/tsconfig.json",
"exclude": ["**/node_modules/*", "blog", "docs", "build", "i18n"],
"compilerOptions": {
"baseUrl": ".",
"target": "ES2017",
"moduleResolution": "Node",
"resolveJsonModule": true,
"types": ["jest"]
"target": "ES2015"
},
"ts-node": {
// these options are overrides used only by ts-node
// same as the --compilerOptions flag and the TS_NODE_COMPILER_OPTIONS environment variable
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "Node"
}
Comment on lines +8 to +14
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use ts-node specifically to run docusaurusConfig.ts from docusaurus.config.js.

}
}
Loading