Skip to content

Commit

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

Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
SalahAdDin committed Jun 13, 2021
1 parent d8c9eb4 commit 1a1b24b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,20 @@
"John Otander <johnotander@gmail.com> (https://johno.com)",
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"Brent Jackson <jxnblk@gmail.com>",
"Michele Bertoli <michele@berto.li>"
"Michele Bertoli <michele@berto.li>",
"José Luis Sandoval Alaguna <alagunasalahaddin@live.com> (https://uzmani.tech/)"
],
"types": "types/index.d.ts",
"files": [
"types/index.d.ts",
"index.js"
],
"dependencies": {
"hast-util-whitespace": "^1.0.0",
"unist-util-visit": "^2.0.0"
},
"devDependencies": {
"dtslint": "^4.1.0",
"nyc": "^15.0.0",
"prettier": "^2.0.0",
"remark": "^13.0.0",
Expand All @@ -44,10 +48,11 @@
"xo": "^0.37.0"
},
"scripts": {
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix --ignore types",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test.js",
"test": "npm run format && npm run test-coverage"
"test-types": "dtslint types",
"test": "npm run format && npm run test-coverage && npm run test-types"
},
"nyc": {
"check-coverage": true,
Expand Down
10 changes: 10 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// TypeScript Version: 3.8

import type {Plugin} from 'unified'

/**
* Remark to remove the wrapping paragraph for images.
*/
declare const remarkUnwrapImages: Plugin<[]>

export = remarkUnwrapImages
4 changes: 4 additions & 0 deletions types/remark-unwrap-images-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import unified = require('unified')
import unwrap = require('remark-unwrap-images')

unified().use(unwrap)
14 changes: 14 additions & 0 deletions types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"lib": [
"es2015"
],
"strict": true,
"baseUrl": ".",
"paths": {
"remark-unwrap-images": [
"."
]
}
}
}
7 changes: 7 additions & 0 deletions types/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "dtslint/dtslint.json",
"rules": {
"semicolon": false,
"whitespace": false
}
}

0 comments on commit 1a1b24b

Please sign in to comment.