Skip to content

Commit c6c8e55

Browse files
committed
Refactor package.json, tsconfig.json
1 parent 2731c71 commit c6c8e55

File tree

4 files changed

+27
-26
lines changed

4 files changed

+27
-26
lines changed

index.test-d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import type {Root, Heading, Paragraph} from 'mdast'
12
import {expectType, expectError} from 'tsd'
2-
import {Node} from 'unist'
3-
import {Root, Heading, Paragraph} from 'mdast'
3+
import type {Node} from 'unist'
44
import {filter} from './index.js'
55

66
const root: Root = {type: 'root', children: []}

lib/complex-types.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable @typescript-eslint/ban-types */
2-
31
import type {Node, Parent} from 'unist'
42

53
type MatchesOne<Value, Check> =
@@ -35,5 +33,3 @@ export type Matches<Value, Check> =
3533
Check extends any[]
3634
? MatchesOne<Value, Check[keyof Check]>
3735
: MatchesOne<Value, Check>
38-
39-
/* eslint-enable @typescript-eslint/ban-types */

package.json

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,36 +56,43 @@
5656
"build": "tsc --build --clean && tsc --build && tsd && type-coverage",
5757
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
5858
"test-api": "node --conditions development test.js",
59-
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
59+
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
6060
"test": "npm run build && npm run format && npm run test-coverage"
6161
},
6262
"prettier": {
63-
"tabWidth": 2,
64-
"useTabs": false,
65-
"singleQuote": true,
6663
"bracketSpacing": false,
6764
"semi": false,
68-
"trailingComma": "none"
69-
},
70-
"xo": {
71-
"prettier": true,
72-
"ignore": [
73-
"index.test-d.ts"
74-
]
65+
"singleQuote": true,
66+
"tabWidth": 2,
67+
"trailingComma": "none",
68+
"useTabs": false
7569
},
7670
"remarkConfig": {
7771
"plugins": [
78-
"preset-wooorm"
72+
"remark-preset-wooorm"
7973
]
8074
},
8175
"typeCoverage": {
8276
"atLeast": 100,
8377
"detail": true,
84-
"strict": true,
8578
"ignoreCatch": true,
8679
"#": "needed `any`s",
8780
"ignoreFiles": [
8881
"lib/complex-types.d.ts"
89-
]
82+
],
83+
"strict": true
84+
},
85+
"xo": {
86+
"overrides": [
87+
{
88+
"files": [
89+
"**/*.ts"
90+
],
91+
"rules": {
92+
"@typescript-eslint/ban-types": "off"
93+
}
94+
}
95+
],
96+
"prettier": true
9097
}
9198
}

tsconfig.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
2-
"include": ["**/*.js", "lib/complex-types.d.ts"],
3-
"exclude": ["coverage/", "node_modules/"],
42
"compilerOptions": {
53
"checkJs": true,
4+
"customConditions": ["development"],
65
"declaration": true,
76
"emitDeclarationOnly": true,
87
"exactOptionalPropertyTypes": true,
9-
"forceConsistentCasingInFileNames": true,
108
"lib": ["es2020"],
119
"module": "node16",
12-
"newLine": "lf",
13-
"skipLibCheck": true,
1410
"strict": true,
1511
"target": "es2020"
16-
}
12+
},
13+
"exclude": ["coverage/", "node_modules/"],
14+
"include": ["**/*.js", "lib/complex-types.d.ts"]
1715
}

0 commit comments

Comments
 (0)