File tree 4 files changed +41
-2
lines changed
4 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
+ * .d.ts
2
3
* .log
3
4
coverage /
4
5
node_modules /
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @typedef {import('hast').Element & {tagName: 'script'|'template'} } ScriptOrTemplate
3
+ * @typedef {import('hast-util-is-element').AssertPredicate<ScriptOrTemplate> } AssertScriptOrTemplate
4
+ */
5
+
1
6
import { convertElement } from 'hast-util-is-element'
2
7
3
- /* Check if a node is a script-supporting element */
8
+ /**
9
+ * Check if a node is a script-supporting element.
10
+ * @type {AssertScriptOrTemplate }
11
+ */
12
+ // @ts -ignore Sure, the assertion matches.
4
13
export const scriptSupporting = convertElement ( [ 'script' , 'template' ] )
Original file line number Diff line number Diff line change 27
27
"sideEffects" : false ,
28
28
"type" : " module" ,
29
29
"main" : " index.js" ,
30
+ "types" : " index.d.ts" ,
30
31
"files" : [
32
+ " index.d.ts" ,
31
33
" index.js"
32
34
],
33
35
"dependencies" : {
36
+ "@types/hast" : " ^2.0.0" ,
34
37
"hast-util-is-element" : " ^2.0.0"
35
38
},
36
39
"devDependencies" : {
40
+ "@types/tape" : " ^4.0.0" ,
37
41
"c8" : " ^7.0.0" ,
38
42
"prettier" : " ^2.0.0" ,
39
43
"remark-cli" : " ^9.0.0" ,
40
44
"remark-preset-wooorm" : " ^8.0.0" ,
45
+ "rimraf" : " ^3.0.0" ,
41
46
"tape" : " ^5.0.0" ,
47
+ "type-coverage" : " ^2.0.0" ,
48
+ "typescript" : " ^4.0.0" ,
42
49
"xo" : " ^0.39.0"
43
50
},
44
51
"scripts" : {
52
+ "prepack" : " npm run build && npm run format" ,
53
+ "build" : " rimraf \" *.d.ts\" && tsc && type-coverage" ,
45
54
"format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
46
55
"test-api" : " node test.js" ,
47
56
"test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js" ,
48
- "test" : " npm run format && npm run test-coverage"
57
+ "test" : " npm run build && npm run format && npm run test-coverage"
49
58
},
50
59
"prettier" : {
51
60
"tabWidth" : 2 ,
66
75
"plugins" : [
67
76
" preset-wooorm"
68
77
]
78
+ },
79
+ "typeCoverage" : {
80
+ "atLeast" : 100 ,
81
+ "detail" : true ,
82
+ "strict" : true
69
83
}
70
84
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "include" : [" *.js" ],
3
+ "compilerOptions" : {
4
+ "target" : " ES2020" ,
5
+ "lib" : [" ES2020" ],
6
+ "module" : " ES2020" ,
7
+ "moduleResolution" : " node" ,
8
+ "allowJs" : true ,
9
+ "checkJs" : true ,
10
+ "declaration" : true ,
11
+ "emitDeclarationOnly" : true ,
12
+ "allowSyntheticDefaultImports" : true ,
13
+ "skipLibCheck" : true
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments