Skip to content

Commit e79fa69

Browse files
committed
Update tsconfig.json
1 parent b9802d1 commit e79fa69

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ function point(type) {
4141
function point(node) {
4242
const point = (node && node.position && node.position[type]) || {}
4343

44+
// To do: next major: don’t return points when invalid.
4445
return {
46+
// @ts-expect-error: in practice, null is allowed.
4547
line: point.line || null,
48+
// @ts-expect-error: in practice, null is allowed.
4649
column: point.column || null,
50+
// @ts-expect-error: in practice, null is allowed.
4751
offset: point.offset > -1 ? point.offset : null
4852
}
4953
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
},
4848
"scripts": {
4949
"prepack": "npm run build && npm run format",
50-
"build": "rimraf \"*.d.ts\" && tsc && type-coverage",
50+
"build": "tsc --build --clean && tsc --build && type-coverage",
5151
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
52-
"test-api": "node test.js",
53-
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js",
52+
"test-api": "node --conditions development test.js",
53+
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
5454
"test": "npm run build && npm run format && npm run test-coverage"
5555
},
5656
"prettier": {

tsconfig.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
2-
"include": ["*.js"],
2+
"include": ["**/**.js"],
3+
"exclude": ["coverage/", "node_modules/"],
34
"compilerOptions": {
4-
"target": "ES2020",
5-
"lib": ["ES2020"],
6-
"module": "ES2020",
7-
"moduleResolution": "node",
8-
"allowJs": true,
95
"checkJs": true,
106
"declaration": true,
117
"emitDeclarationOnly": true,
12-
"allowSyntheticDefaultImports": true,
13-
"skipLibCheck": true
8+
"exactOptionalPropertyTypes": true,
9+
"forceConsistentCasingInFileNames": true,
10+
"lib": ["es2020"],
11+
"module": "node16",
12+
"newLine": "lf",
13+
"skipLibCheck": true,
14+
"strict": true,
15+
"target": "es2020"
1416
}
1517
}

0 commit comments

Comments
 (0)