Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions _layouts/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
<link rel="stylesheet" href="/css/normalize.css" type="text/css">
<link rel="stylesheet" href="/css/jekyll/article.css">
<link rel="stylesheet" href="/assets/css/article.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/python.min.js"></script>
Expand All @@ -27,6 +27,6 @@
<p id="thanks">Thanks ❤️</p>
</footer>

<script src="/ts/dist/jekyll/article.js" type="module"></script>
<script src="/assets/js/article.js" type="module"></script>
</body>
</html>
File renamed without changes.
2 changes: 2 additions & 0 deletions assets/js/article.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=article.d.ts.map
1 change: 1 addition & 0 deletions assets/js/article.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions ts/dist/jekyll/article.js → assets/js/article.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/js/article.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
238 changes: 238 additions & 0 deletions assets/ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions assets/ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "ts",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

The package.json is missing a build script to compile TypeScript to JavaScript. Add a "build" script like "tsc" or "tsc --watch" to the scripts section so developers know how to compile the TypeScript code.

Suggested change
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc"

Copilot uses AI. Check for mistakes.
},
"keywords": [],
"author": "",
"license": "ISC",
"type": "commonjs",
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

The tsconfig.json uses "module": "esnext" and "target": "esnext", but package.json specifies "type": "commonjs". This creates a mismatch where TypeScript will emit ES modules but Node.js will expect CommonJS. Either change the package.json type to "module" or adjust the TypeScript module setting to align with CommonJS.

Suggested change
"type": "commonjs",
"type": "module",

Copilot uses AI. Check for mistakes.
"devDependencies": {
"@types/node": "^25.0.2",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
}
}
44 changes: 44 additions & 0 deletions assets/ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
// Visit https://aka.ms/tsconfig to read more about this file
"compilerOptions": {
// File Layout
// "rootDir": "./src",
"outDir": "../js",

// Environment Settings
// See also https://aka.ms/tsconfig/module
"module": "esnext",
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

Using "module": "esnext" is not recommended for production code as it's a moving target. Consider using a specific module format like "ES2022" or "ESNext" spelled consistently. The main ts/tsconfig.json uses "ESNext" (capital N).

Suggested change
"module": "esnext",
"module": "ESNext",

Copilot uses AI. Check for mistakes.
"target": "esnext",
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

Using "target": "esnext" is not recommended for production code as it's a moving target that changes with each TypeScript version. Consider using a specific version like "ES2022" (as used in the main ts/tsconfig.json) for consistency and predictability.

Suggested change
"target": "esnext",
"target": "ES2022",

Copilot uses AI. Check for mistakes.
"types": [],
// For nodejs:
// "lib": ["esnext"],
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

The types array is set to empty ([]), but the code uses DOM APIs like document and window. Without specifying DOM types, TypeScript should throw errors unless lib includes DOM types. Consider adding "lib": ["ESNext", "DOM"] to ensure proper type checking for browser APIs.

Suggested change
// "lib": ["esnext"],
"lib": ["ESNext", "DOM"],

Copilot uses AI. Check for mistakes.
// "types": ["node"],
// and npm install -D @types/node

// Other Outputs
"sourceMap": true,
"declaration": true,
"declarationMap": true,

// Stricter Typechecking Options
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,

// Style Options
// "noImplicitReturns": true,
// "noImplicitOverride": true,
// "noUnusedLocals": true,
// "noUnusedParameters": true,
// "noFallthroughCasesInSwitch": true,
// "noPropertyAccessFromIndexSignature": true,

// Recommended Options
"strict": true,
"jsx": "react-jsx",
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

The jsx compiler option is set to "react-jsx", but there are no React dependencies in package.json and the code doesn't use JSX. This option should be removed unless React is intended to be added.

Suggested change
"jsx": "react-jsx",

Copilot uses AI. Check for mistakes.
"verbatimModuleSyntax": true,
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"moduleDetection": "force",
"skipLibCheck": true,
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

Trailing comma after the last property in compilerOptions will cause a JSON parsing error. Remove the comma after "skipLibCheck": true.

Suggested change
"skipLibCheck": true,
"skipLibCheck": true

Copilot uses AI. Check for mistakes.
}
}