Skip to content

Commit 14c2326

Browse files
committed
feat: enable incremental compilation and update TypeScript configuration standards
1 parent c9848c0 commit 14c2326

2 files changed

Lines changed: 48 additions & 3 deletions

File tree

.github/copilot-instructions.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
applyTo: "**"
3+
---
4+
5+
# TypeScript Node.js Project Standards
6+
7+
## Module System
8+
- Use ES modules (`import`/`export`) - this project is configured with `"type": "module"` in package.json
9+
10+
## TypeScript Configuration
11+
- Follow strict TypeScript settings - all strict options are enabled
12+
- Use `NodeNext` module resolution and `ES2022` target
13+
- Generate declaration files for all exported types
14+
- Remove comments in compiled output
15+
- Enable incremental compilation for faster builds
16+
17+
## Development Tools
18+
- Use `tsx` for development with watch mode (`npm run dev`)
19+
- Use `vitest` for testing (not Jest) - test files should use `.test.ts` extension (`npm run test`)
20+
- Use `eslint` for linting (`npm run lint`)
21+
22+
## Code Style
23+
- Use single quotes for strings
24+
- Use 2 spaces for indentation
25+
- Prefer `const` over `let` when possible
26+
- Use async/await over promises (top-level await is supported)
27+
- Use proper TypeScript types instead of `any`
28+
29+
## Testing
30+
- Place test files alongside source files with `.test.ts` extension
31+
32+
## Environment Configuration
33+
- Use dotenv for environment variables with `import 'dotenv/config'`
34+
- Load environment configuration at the top of entry files
35+
36+
## Project Structure
37+
- Source files in `src/` directory
38+
- Compiled output in `dist/` directory
39+
- Entry point: `src/index.ts` compiles to `dist/index.js`
40+
- Type definitions generated as `dist/index.d.ts`
41+
42+
## Dependencies
43+
- Keep dependencies minimal and focused
44+
- Use `@types/node` for Node.js type definitions
45+
- Prefer modern Node.js APIs and features

tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
/* Basic Options */
4-
// "incremental": true, /* Enable incremental compilation */
4+
"incremental": true, /* Enable incremental compilation */
55
"target": "ES2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
66
"module": "NodeNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
77
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -36,7 +36,7 @@
3636
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
3737
/* Module Resolution Options */
3838
"moduleResolution": "nodenext", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
39-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
39+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
4040
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
4141
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
4242
// "typeRoots": [], /* List of folders to include type definitions from. */
@@ -57,6 +57,6 @@
5757
"exclude": [
5858
"dist",
5959
"node_modules",
60-
"tests"
60+
"**/*.spec.ts",
6161
]
6262
}

0 commit comments

Comments
 (0)