Skip to content

Commit

Permalink
Enable lib-check while developing
Browse files Browse the repository at this point in the history
Then disable it on `npm run lint`.

lib-check cannot exclude `node_modules`:

* microsoft/TypeScript#30511
  • Loading branch information
kui committed Jun 16, 2023
1 parent ef7947c commit 5575f07
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"lint": "run-p lint:**",
"lint:prettier": "prettier --check .",
"lint:eslint": "eslint --ext .ts .",
"lint:tsc:src": "tsc -p src",
"lint:tsc:tools": "tsc -p tools",
"lint:tsc:src": "tsc -p src --skipLibCheck",
"lint:tsc:tools": "tsc -p tools --skipLibCheck",
"test": "jest --config src/jest.config.ts",
"ci": "run-p lint test"
},
Expand Down
1 change: 0 additions & 1 deletion src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"lib": ["esnext", "dom", "webworker"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"noEmit": true
Expand Down
2 changes: 1 addition & 1 deletion src/types/pngjs.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module "pngjs/browser" {
declare module "pngjs/browser" {
export * from "pngjs";
}
1 change: 1 addition & 0 deletions src/types/webworker.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Workaround for weird semver of typescript :(
// See https://github.com/microsoft/TypeScript/issues/45745
// Copy from https://github.com/microsoft/TypeScript/blob/v4.3.5/lib/lib.webworker.d.ts
// @ts-nocheck
class OffscreenCanvas extends EventTarget {
constructor(width: number, height: number);
/**
Expand Down
2 changes: 1 addition & 1 deletion tools/generate-jsons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { promises as fs } from "fs";
import * as path from "path";
import glob from "glob-promise";
import { BlockId, BlockIdNames, parseNim } from "./lib/nim-parser";
import { LabelId, parseLabel } from "./lib/label-parser";
import { parseLabel } from "./lib/label-parser";
import { parseTts } from "./lib/tts-parser";
import * as utils from "./lib/utils";

Expand Down
2 changes: 1 addition & 1 deletion tools/generate-prefab-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from "path";
import { promises as fs } from "fs";
import glob from "glob-promise";
import { prefabHtml } from "./lib/prefab-html";
import { LabelId, parseLabel } from "./lib/label-parser";
import { parseLabel } from "./lib/label-parser";
import { handleMain, projectRoot, vanillaDir } from "./lib/utils";

const BASE_DEST = projectRoot("docs", "prefabs");
Expand Down
2 changes: 0 additions & 2 deletions tools/lib/label-parser.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import fs from "fs";
import { Parser, parse as csvParse } from "csv-parse";

export type LabelId = string;

const LANGUAGES: Languages = [
"english",
"german",
Expand Down
1 change: 0 additions & 1 deletion tools/lib/prefab-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as path from "path";
import { parseNim } from "./nim-parser";
import { parseTts } from "./tts-parser";
import { parseXml } from "./xml-parser";
import { LabelId } from "./label-parser";

interface HtmlModel {
name: string;
Expand Down
1 change: 0 additions & 1 deletion tools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"lib": ["es2020"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true
}
Expand Down
8 changes: 4 additions & 4 deletions tools/types/label.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const LANGUAGES = [
type Languages = [
"english",
"german",
"spanish",
Expand All @@ -11,10 +11,10 @@ const LANGUAGES = [
"russian",
"turkish",
"schinese",
"tchinese",
] as const;
"tchinese"
];

type Languages = typeof LANGUAGES;
type LabelId = string;

type LabelCore = {
[lang in Languages[number]]: string;
Expand Down

0 comments on commit 5575f07

Please sign in to comment.