Skip to content

Commit e7f2ae8

Browse files
committed
add dtslint
1 parent 620f14e commit e7f2ae8

File tree

5 files changed

+47
-1
lines changed

5 files changed

+47
-1
lines changed

mdast-util-from-markdown.min.js.tmp-browserify-96696307650534585321

Whitespace-only changes.

micromark.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This file is for https://github.com/microsoft/dtslint .
2+
// Tests are type-checked, but not run.
3+
4+
import * as formMarkdown from 'mdast-util-from-markdown'
5+
6+
function main() {
7+
const raw = '# text **strong**'
8+
9+
// $ExpectType Root
10+
formMarkdown(raw)
11+
12+
// $ExpectType Root
13+
formMarkdown(Buffer.alloc(8))
14+
15+
// $ExpectType Root
16+
formMarkdown(Buffer.alloc(8), {extensions: []})
17+
18+
// $ExpectType Root
19+
formMarkdown(Buffer.alloc(8), 'utf-8', {mdastExtensions: []})
20+
}
21+
22+
main()

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"devDependencies": {
4141
"browserify": "^16.0.0",
4242
"commonmark.json": "^0.29.0",
43+
"dtslint": "^4.0.0",
4344
"gzip-size-cli": "^3.0.0",
4445
"hast-util-to-html": "^7.0.0",
4546
"mdast-util-to-hast": "^10.0.0",
@@ -60,7 +61,8 @@
6061
"generate": "npm run generate-size",
6162
"test-api": "node test",
6263
"test-coverage": "nyc --reporter lcov tape test/index.js",
63-
"test": "npm run format && npm run generate && npm run test-coverage"
64+
"test-types": "dtslint .",
65+
"test": "npm run format && npm run generate && npm run test-coverage && npm run test-types"
6466
},
6567
"nyc": {
6668
"check-coverage": true,

tsconfig.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"moduleResolution": "node",
4+
"lib": [
5+
"ES5"
6+
],
7+
"strict": true,
8+
"baseUrl": ".",
9+
"paths": {
10+
"mdast-util-from-markdown": [
11+
"index.d.ts"
12+
]
13+
}
14+
}
15+
}

tslint.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "dtslint/dtslint.json",
3+
"rules": {
4+
"semicolon": false,
5+
"whitespace": false
6+
}
7+
}

0 commit comments

Comments
 (0)