Skip to content

Commit

Permalink
chore: update typescript@5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Mar 6, 2024
1 parent c1c252f commit 1a4a4ff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -19,7 +19,7 @@
"rimraf": "5.0.5",
"tsconfig-plantain": "0.0.2",
"tsx": "3.12.10",
"typescript": "5.3.3",
"typescript": "5.4.2",
"vscode": "1.1.37"
},
"scripts": {
Expand All @@ -34,6 +34,6 @@
],
"private": true,
"typeCoverage": {
"atLeast": 99.5
"atLeast": 99.52
}
}
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Expand Up @@ -362,7 +362,7 @@ async function saveHistory(percentage: number, historyFile?:string) {
const historyFilePath = path.resolve(process.cwd(), historyFile);
if (await existsAsync(historyFilePath)) {
const date = new Date().toISOString()
const historyFile = JSON.parse((await readFileAsync(historyFilePath)).toString());
const historyFile: Record<string, number> = JSON.parse((await readFileAsync(historyFilePath)).toString());
historyFile[date] = percentage
await writeFileAsync(historyFilePath, JSON.stringify(historyFile, null, 2) + '\n');
} else {
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/checker.ts
Expand Up @@ -139,9 +139,7 @@ function checkTypeAssertion(node: ts.Node, context: FileContext, kind: FileAnyIn
return
}
// exclude safe type assertion powered by isTypeAssignableTo
const checker = context.checker as unknown as {
isTypeAssignableTo?: (type1: ts.Type, type2: ts.Type) => boolean
} & typeof context.checker
const checker = context.checker
if (checker.isTypeAssignableTo
&& checker.isTypeAssignableTo(checker.getTypeAtLocation(node.expression), checker.getTypeFromTypeNode(node.type))) {
return
Expand Down
5 changes: 3 additions & 2 deletions packages/plugin/src/index.ts
Expand Up @@ -8,14 +8,15 @@ function init(modules: { typescript: typeof tsserverlibrary }) {
const proxy: tsserverlibrary.LanguageService = {
...info.languageService,
getSemanticDiagnostics(fileName) {
if (!info.config?.jsEnable && (fileName.endsWith('.js') || fileName.endsWith('.jsx'))) {
const config: { jsEnable: boolean } = info.config
if (!config?.jsEnable && (fileName.endsWith('.js') || fileName.endsWith('.jsx'))) {
return []
}
const result = lintSync(
info.project.getCompilerOptions(),
info.project.getRootFiles(),
{
...info.config,
...config,
files: [fileName],
oldProgram,
},
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Expand Up @@ -2032,6 +2032,11 @@ typescript@5.3.3:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37"
integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==

typescript@5.4.2:
version "5.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.2.tgz#0ae9cebcfae970718474fe0da2c090cad6577372"
integrity sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==

uc.micro@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.0.0.tgz#84b3c335c12b1497fd9e80fcd3bfa7634c363ff1"
Expand Down

0 comments on commit 1a4a4ff

Please sign in to comment.