Skip to content

Commit 8134e93

Browse files
amends based on reviews
1 parent eba500f commit 8134e93

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@
3434
"types/index.d.ts"
3535
],
3636
"types": "types/index.d.ts",
37+
"ignores": [
38+
"types"
39+
],
3740
"dependencies": {
38-
"dtslint": "^4.0.7",
3941
"unist-util-is": "^4.0.0"
4042
},
4143
"devDependencies": {
44+
"dtslint": "^4.0.0",
4245
"nyc": "^15.0.0",
4346
"prettier": "^2.0.0",
4447
"remark-cli": "^9.0.0",
@@ -51,8 +54,8 @@
5154
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
5255
"test-api": "node test",
5356
"test-coverage": "nyc --reporter lcov tape test.js",
54-
"test": "npm run format && npm run test-coverage",
55-
"test-types": "dtslint types"
57+
"test-types": "dtslint types",
58+
"test": "npm run format && npm run test-coverage && npm run test-types"
5659
},
5760
"nyc": {
5861
"check-coverage": true,
@@ -88,4 +91,4 @@
8891
"preset-wooorm"
8992
]
9093
}
91-
}
94+
}

types/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { Test } from 'unist-util-is';
55

66
declare namespace remove {
77
interface RemoveOptions {
8+
/**
9+
* Whether to drop parent nodes if they had children, but all their children were filtered out test
10+
*/
811
cascade?: boolean;
912
}
1013
}
@@ -17,6 +20,11 @@ declare namespace remove {
1720
* @param options Whether to drop parent nodes if they had children, but all their children were filtered out
1821
* @param test is-compatible test (such as a type)
1922
*/
23+
declare function remove(
24+
tree: Node,
25+
test?: Test<Node>
26+
): Node;
27+
2028
declare function remove(
2129
tree: Node,
2230
options: remove.RemoveOptions = {cascade: true},

types/tsconfig.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2017",
4+
"lib": ["es6"],
5+
"module": "commonjs",
6+
"moduleResolution": "node",
7+
"resolveJsonModule": true,
8+
"esModuleInterop": false,
9+
"strict": true,
10+
"strictPropertyInitialization": false,
11+
"experimentalDecorators": true,
12+
"emitDecoratorMetadata": true,
13+
"sourceMap": true,
14+
"skipLibCheck": true
15+
},
16+
"include": [
17+
"./**/*.ts",
18+
"./node_modules/@types"
19+
],
20+
"exclude": [
21+
"node_modules",
22+
"coverage"
23+
]
24+
}
25+

0 commit comments

Comments
 (0)