Skip to content

Commit f8b45f2

Browse files
authored
Fix tsconfig and lint types (#12)
1 parent bf2f862 commit f8b45f2

File tree

7 files changed

+36
-25
lines changed

7 files changed

+36
-25
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,18 @@ jobs:
3434
run: yarn install --immutable
3535
- name: Check for duplicate dependencies
3636
run: yarn dedupe --check
37-
- name: Setup tools cache
37+
- name: Setup lint cache
3838
uses: actions/[email protected]
3939
with:
4040
path: node_modules/.cache
41-
key: tools-${{ github.sha }}
42-
restore-keys: tools-
41+
key: lint-${{ github.sha }}
42+
restore-keys: lint-
4343
- name: Check javascript and typescript
4444
run: yarn run lint:js
4545
- name: Check format
4646
run: yarn run lint:format
47+
- name: Check types
48+
run: yarn run lint:types
4749
- name: Build package
4850
run: yarn run build
4951
#- name: Run Tests

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default [
3636
parser: typescriptParser,
3737
parserOptions: {
3838
ecmaVersion: "latest",
39-
project: "tsconfig-lint.json",
39+
project: "tsconfig.json",
4040
tsconfigRootDir: rootDir,
4141
},
4242
},
File renamed without changes.

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
},
3232
"type": "module",
3333
"files": [
34-
"dist/"
34+
"dist/",
35+
"!dist/*.tsbuildinfo"
3536
],
3637
"exports": "./dist/index.cjs",
3738
"types": "./dist/index.d.cts",
@@ -41,10 +42,11 @@
4142
"fix": "yarn run lint:js --fix",
4243
"format": "prettier --cache --write .",
4344
"lint:format": "prettier --cache --check .",
44-
"lint": "yarn dedupe --check && yarn run lint:js && yarn run lint:format",
45-
"build": "tsc",
46-
"test": "mocha",
47-
"clean": "rm -rf dist",
45+
"lint:types": "tsc",
46+
"lint": "yarn dedupe --check && yarn run lint:js && yarn run lint:format && yarn run lint:types",
47+
"build": "tsc --build src",
48+
"test": "mocha --config mocha.config.cjs",
49+
"clean": "tsc --build --clean",
4850
"prepublish": "yarn run lint",
4951
"prepack": "yarn run build",
5052
"postpack": "yarn run clean"

src/tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
// Emit
5+
"noEmit": false,
6+
"declaration": true,
7+
"declarationMap": true,
8+
"sourceMap": true,
9+
"outDir": "../dist",
10+
// Project
11+
"composite": true
12+
}
13+
}

tsconfig-lint.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

tsconfig.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
2-
"include": ["src/**/*"],
2+
"references": [
3+
{
4+
"path": "src"
5+
}
6+
],
37
"compilerOptions": {
48
// Language and Environment
59
"target": "ES2021",
610
// Modules
711
"module": "Node16",
8-
"rootDir": "src",
9-
// Emit
10-
"declaration": true,
11-
"declarationMap": true,
12-
"sourceMap": true,
13-
"outDir": "dist",
14-
// Caching
12+
// Emit/Project (only type check with cache)
13+
"noEmit": true,
1514
"incremental": true,
16-
"tsBuildInfoFile": "node_modules/.cache/typescript/.tsbuildinfo",
15+
"outDir": "node_modules/.cache/typescript",
16+
// JavaScript Support
17+
"allowJs": true,
1718
// Interop Constraints
1819
"esModuleInterop": true,
1920
"forceConsistentCasingInFileNames": true,

0 commit comments

Comments
 (0)