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
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ci
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
validate-configs:
name: validate configs (typescript ${{ matrix.typescript }})
runs-on: ubuntu-latest
strategy:
matrix:
typescript: [ 6, 7 ]
steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Install typescript ${{ matrix.typescript }}
run: npm install --no-save typescript@${{ matrix.typescript }}

- name: Validate configs
run: npm run validate-configs
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,6 @@ Temporary Items

.idea/
public/

# scripts/validate-configs.mjs scratch dir (created and removed at runtime)
.tmp-validate-*/
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ This package contains a universal tsconfig file that is optimized for browser, l

## Compatibility

- `@getresponse/tsconfig@2.x` - TypeScript >=6.0.0 <7.0.0
- `@getresponse/tsconfig@3.x` - TypeScript >=6.0.0 <8.0.0
- `@getresponse/tsconfig@2.x` - TypeScript >=6.0.0 <7.0.0 (no longer maintained)
- `@getresponse/tsconfig@1.x` - TypeScript 5.x (no longer maintained)

## Installation
Expand Down Expand Up @@ -74,4 +75,11 @@ This package contains a universal tsconfig file that is optimized for browser, l

Note: `node-lts` configs already include `"types": ["node"]` by default.

6. `tsconfig.base.json`, `lib/tsconfig.esm.json`, and `node-lts/tsconfig.json` use `"moduleResolution": "nodenext"`, which requires:

- `"type": "module"` in your project's `package.json`
- explicit file extensions on relative imports, e.g. `import { helper } from './helper.js'` (not `'./helper'`), even though the source file is `helper.ts`

`browser/tsconfig.json`, `lib/tsconfig.cjs.json`, and `node-lts/tsconfig.cjs.json` use `"moduleResolution": "bundler"` instead and are not affected by either requirement.

That's it! Now you can enjoy the benefits of using a standardized tsconfig file in your TypeScript projects.
4 changes: 4 additions & 0 deletions configs/browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler"
}
}
1 change: 1 addition & 0 deletions configs/lib/tsconfig.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"extends": "./tsconfig.esm.json",
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "bundler"
}
}
2 changes: 1 addition & 1 deletion configs/node-lts/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"module": "commonjs",
"moduleResolution": "bundler",
"target": "es2022"
}
}
Expand Down
2 changes: 1 addition & 1 deletion configs/node-lts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../tsconfig.base.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"module": "es2022",
"experimentalDecorators": true,
"target": "es2022",
"types": ["node"]
}
Expand Down
2 changes: 1 addition & 1 deletion configs/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"sourceMap": true,
"allowJs": false,
"jsx": "react",
"module": "esnext",
"module": "nodenext",
"moduleResolution": "nodenext",
"noImplicitReturns": true,
"noUnusedLocals": false,
Expand Down
Loading
Loading