Skip to content

Commit f6bd64e

Browse files
committed
Refactor tsconfigs for perf and strictness
1 parent e69e55f commit f6bd64e

File tree

13 files changed

+32
-31
lines changed

13 files changed

+32
-31
lines changed

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
},
1212
"type": "module",
1313
"workspaces": [
14-
"packages/remark-parse",
15-
"packages/remark-stringify",
16-
"packages/remark",
17-
"packages/remark-cli"
14+
"packages/remark-parse/",
15+
"packages/remark-stringify/",
16+
"packages/remark/",
17+
"packages/remark-cli/"
1818
],
1919
"devDependencies": {
2020
"@types/mdast": "^3.0.0",
@@ -36,7 +36,8 @@
3636
"xo": "^0.54.0"
3737
},
3838
"scripts": {
39-
"build": "npm run build --workspaces && rimraf \"*.d.ts\" \"{test,script}/**/*.d.ts\" && tsc && type-coverage",
39+
"prepack": "npm run build && npm run format",
40+
"build": "tsc --build --clean && tsc --build && type-coverage",
4041
"format": "./packages/remark-cli/cli.js . -qfo && prettier . -w --loglevel warn && xo --fix",
4142
"test-api": "npm run test --workspaces && node --conditions development test/index.js",
4243
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api",

packages/remark-cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"unified-args": "^10.0.0"
3636
},
3737
"scripts": {
38-
"build": "rimraf \"*.d.ts\" && tsc && type-coverage",
3938
"test": "node --conditions development test.js"
4039
},
4140
"xo": false,

packages/remark-cli/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"extends": "../../tsconfig.json",
3-
"include": ["*.js"],
4-
"compilerOptions": {
5-
"resolveJsonModule": true
6-
}
3+
"references": [{"path": "../remark/"}]
74
}

packages/remark-parse/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {Root} from 'mdast'
33
import type {Plugin} from 'unified'
44
import type {Options} from './lib/index.js'
55

6-
declare const remarkParse: Plugin<[Options?] | void[], string, Root>
6+
declare const remarkParse: Plugin<[(Options | undefined)?], string, Root>
77
export default remarkParse
88

99
export type {Options} from './lib/index.js'

packages/remark-parse/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
"unified": "^10.0.0"
4747
},
4848
"scripts": {
49-
"test": "node --conditions development test.js",
50-
"build": "rimraf \"test.d.ts\" \"lib/**/*.d.ts\" && tsc && type-coverage"
49+
"test": "node --conditions development test.js"
5150
},
5251
"xo": false,
5352
"typeCoverage": {
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"extends": "../../tsconfig.json",
3-
"include": ["lib/**/*.js", "test.js"]
2+
"extends": "../../tsconfig.json"
43
}

packages/remark-stringify/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {Root} from 'mdast'
33
import type {Plugin} from 'unified'
44
import type {Options} from './lib/index.js'
55

6-
declare const remarkStringify: Plugin<[Options?] | void[], Root, string>
6+
declare const remarkStringify: Plugin<[(Options | undefined)?], Root, string>
77
export default remarkStringify
88

99
export type {Options} from './lib/index.js'

packages/remark-stringify/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {toMarkdown} from 'mdast-util-to-markdown'
88

99
/**
1010
* @this {import('unified').Processor}
11-
* @type {import('unified').Plugin<[Options]|void[], Node, string>}
11+
* @type {import('unified').Plugin<[Options?]|void[], Node, string>}
1212
*/
1313
export default function remarkStringify(options) {
1414
/** @type {import('unified').CompilerFunction<Node, string>} */

packages/remark-stringify/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
"unified": "^10.0.0"
4747
},
4848
"scripts": {
49-
"test": "node --conditions development test.js",
50-
"build": "rimraf \"test.d.ts\" \"lib/**/*.d.ts\" && tsc && type-coverage"
49+
"test": "node --conditions development test.js"
5150
},
5251
"xo": false,
5352
"typeCoverage": {
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"extends": "../../tsconfig.json",
3-
"include": ["lib/**/*.js", "test.js"]
2+
"extends": "../../tsconfig.json"
43
}

0 commit comments

Comments
 (0)