Skip to content

Commit

Permalink
Add types
Browse files Browse the repository at this point in the history
Closes GH-12.

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: Junyoung Choi <fluke8259@gmail.com>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
remcohaszing committed Apr 6, 2020
1 parent bc9cf30 commit 65b8410
Show file tree
Hide file tree
Showing 31 changed files with 142 additions and 122 deletions.
1 change: 1 addition & 0 deletions .prettierignore
@@ -1,3 +1,4 @@
coverage/
remark-frontmatter.js
remark-frontmatter.min.js
*.md
13 changes: 9 additions & 4 deletions package.json
Expand Up @@ -28,14 +28,17 @@
],
"files": [
"index.js",
"lib"
"lib",
"types/index.d.ts"
],
"types": "types/index.d.ts",
"dependencies": {
"fault": "^1.0.1",
"xtend": "^4.0.1"
},
"devDependencies": {
"browserify": "^16.0.0",
"dtslint": "^3.4.1",
"is-hidden": "^1.0.0",
"not": "^0.1.0",
"nyc": "^15.0.0",
Expand All @@ -50,13 +53,14 @@
"xo": "^0.28.0"
},
"scripts": {
"format": "remark *.md -qfo && prettier --write \"**/*.js\" && xo --fix",
"format": "remark *.md -qfo && prettier --write . && xo --fix",
"build-bundle": "browserify . -s remarkFrontmatter > remark-frontmatter.js",
"build-mangle": "browserify . -s remarkFrontmatter -p tinyify > remark-frontmatter.min.js",
"build": "npm run build-bundle && npm run build-mangle",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test/index.js",
"test": "npm run format && npm run build && npm run test-coverage"
"test-types": "dtslint types",
"test": "npm run format && npm run build && npm run test-coverage && npm run test-types"
},
"nyc": {
"check-coverage": true,
Expand All @@ -79,7 +83,8 @@
"guard-for-in": "off"
},
"ignores": [
"remark-frontmatter.js"
"remark-frontmatter.js",
"**/*.ts"
]
},
"remarkConfig": {
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/config-options-as-matter/tree.json
Expand Up @@ -15,9 +15,7 @@
"column": 4,
"offset": 7
},
"indent": [
1
]
"indent": [1]
}
},
{
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/config-options-as-string/tree.json
Expand Up @@ -15,9 +15,7 @@
"column": 4,
"offset": 7
},
"indent": [
1
]
"indent": [1]
}
},
{
Expand Down
5 changes: 1 addition & 4 deletions test/fixtures/core-yaml-delayed/tree.json
Expand Up @@ -15,10 +15,7 @@
"column": 4,
"offset": 21
},
"indent": [
1,
1
]
"indent": [1, 1]
}
},
{
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/core-yaml-not-at-top/tree.json
Expand Up @@ -86,9 +86,7 @@
"column": 4,
"offset": 49
},
"indent": [
1
]
"indent": [1]
}
},
{
Expand Down
8 changes: 1 addition & 7 deletions test/fixtures/custom-deep/tree.json
Expand Up @@ -15,13 +15,7 @@
"column": 4,
"offset": 49
},
"indent": [
1,
1,
1,
1,
1
]
"indent": [1, 1, 1, 1, 1]
}
},
{
Expand Down
10 changes: 2 additions & 8 deletions test/fixtures/custom-default/tree.json
Expand Up @@ -34,10 +34,7 @@
"column": 2,
"offset": 27
},
"indent": [
1,
1
]
"indent": [1, 1]
}
}
],
Expand All @@ -52,10 +49,7 @@
"column": 2,
"offset": 27
},
"indent": [
1,
1
]
"indent": [1, 1]
}
},
{
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/custom-empty/tree.json
Expand Up @@ -15,9 +15,7 @@
"column": 4,
"offset": 7
},
"indent": [
1
]
"indent": [1]
}
},
{
Expand Down
8 changes: 1 addition & 7 deletions test/fixtures/custom-fence-long/tree.json
Expand Up @@ -15,13 +15,7 @@
"column": 11,
"offset": 63
},
"indent": [
1,
1,
1,
1,
1
]
"indent": [1, 1, 1, 1, 1]
}
},
{
Expand Down
8 changes: 1 addition & 7 deletions test/fixtures/custom-fence-openclose/tree.json
Expand Up @@ -15,13 +15,7 @@
"column": 8,
"offset": 56
},
"indent": [
1,
1,
1,
1,
1
]
"indent": [1, 1, 1, 1, 1]
}
},
{
Expand Down
8 changes: 1 addition & 7 deletions test/fixtures/custom-fence-short/tree.json
Expand Up @@ -15,13 +15,7 @@
"column": 3,
"offset": 47
},
"indent": [
1,
1,
1,
1,
1
]
"indent": [1, 1, 1, 1, 1]
}
},
{
Expand Down
8 changes: 1 addition & 7 deletions test/fixtures/custom-fence/tree.json
Expand Up @@ -15,13 +15,7 @@
"column": 4,
"offset": 49
},
"indent": [
1,
1,
1,
1,
1
]
"indent": [1, 1, 1, 1, 1]
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/custom-marker-openclose/config.json
@@ -1 +1 @@
[{"type": "jsonml", "marker": { "open": "<", "close": ">" }}]
[{"type": "jsonml", "marker": {"open": "<", "close": ">"}}]
8 changes: 1 addition & 7 deletions test/fixtures/custom-marker-openclose/tree.json
Expand Up @@ -15,13 +15,7 @@
"column": 4,
"offset": 49
},
"indent": [
1,
1,
1,
1,
1
]
"indent": [1, 1, 1, 1, 1]
}
},
{
Expand Down
5 changes: 1 addition & 4 deletions test/fixtures/custom-yaml-anywhere/tree.json
Expand Up @@ -51,10 +51,7 @@
"column": 4,
"offset": 42
},
"indent": [
1,
1
]
"indent": [1, 1]
}
},
{
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/toml-advanced/config.json
@@ -1,3 +1 @@
[
"toml"
]
["toml"]
4 changes: 1 addition & 3 deletions test/fixtures/toml-deep/config.json
@@ -1,3 +1 @@
[
"toml"
]
["toml"]
6 changes: 1 addition & 5 deletions test/fixtures/toml-deep/tree.json
Expand Up @@ -15,11 +15,7 @@
"column": 4,
"offset": 43
},
"indent": [
1,
1,
1
]
"indent": [1, 1, 1]
}
},
{
Expand Down
10 changes: 2 additions & 8 deletions test/fixtures/toml-default/tree.json
Expand Up @@ -18,10 +18,7 @@
"column": 4,
"offset": 22
},
"indent": [
1,
1
]
"indent": [1, 1]
}
}
],
Expand All @@ -36,10 +33,7 @@
"column": 4,
"offset": 22
},
"indent": [
1,
1
]
"indent": [1, 1]
}
},
{
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/toml-empty/config.json
@@ -1,3 +1 @@
[
"toml"
]
["toml"]
4 changes: 1 addition & 3 deletions test/fixtures/toml-empty/tree.json
Expand Up @@ -15,9 +15,7 @@
"column": 4,
"offset": 7
},
"indent": [
1
]
"indent": [1]
}
},
{
Expand Down
8 changes: 2 additions & 6 deletions test/fixtures/toml-unconfigured/tree.json
Expand Up @@ -18,9 +18,7 @@
"column": 4,
"offset": 7
},
"indent": [
1
]
"indent": [1]
}
}
],
Expand All @@ -35,9 +33,7 @@
"column": 4,
"offset": 7
},
"indent": [
1
]
"indent": [1]
}
},
{
Expand Down
7 changes: 1 addition & 6 deletions test/fixtures/yaml-deep/tree.json
Expand Up @@ -15,12 +15,7 @@
"column": 4,
"offset": 44
},
"indent": [
1,
1,
1,
1
]
"indent": [1, 1, 1, 1]
}
},
{
Expand Down
5 changes: 1 addition & 4 deletions test/fixtures/yaml-default/tree.json
Expand Up @@ -15,10 +15,7 @@
"column": 4,
"offset": 22
},
"indent": [
1,
1
]
"indent": [1, 1]
}
},
{
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/yaml-empty/tree.json
Expand Up @@ -15,9 +15,7 @@
"column": 4,
"offset": 7
},
"indent": [
1
]
"indent": [1]
}
},
{
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/yaml-unconfigured/config.json
@@ -1,3 +1 @@
[
"toml"
]
["toml"]

0 comments on commit 65b8410

Please sign in to comment.