Skip to content

Commit

Permalink
Add JSDoc based types
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Apr 11, 2021
1 parent 9e0ccb2 commit d27cd59
Show file tree
Hide file tree
Showing 9 changed files with 503 additions and 161 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
coverage/
lib/
node_modules/
*.d.ts
*.log
.DS_Store
package-lock.json
Expand Down
77 changes: 0 additions & 77 deletions index.d.ts

This file was deleted.

25 changes: 18 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,11 @@
"Dennis S <denis.s@svsg.co>",
"Evan Hensleigh <futuraprime@gmail.com>"
],
"types": "index.d.ts",
"types": "lib/react-markdown.d.ts",
"main": "lib/react-markdown.js",
"unpkg": "react-markdown.min.js",
"files": [
"lib/",
"plugins/",
"index.d.ts",
"react-markdown.min.js"
],
"dependencies": {
Expand All @@ -88,7 +86,6 @@
"space-separated-tokens": "^1.1.0",
"style-to-object": "^0.3.0",
"unified": "^9.0.0",
"unist-util-is": "^4.1.0",
"unist-util-visit": "^2.0.0"
},
"peerDependencies": {
Expand All @@ -107,10 +104,12 @@
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-replace": "^2.0.0",
"@testing-library/react": "^11.0.0",
"@types/jest": "^26.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-is": "^17.0.0",
"@types/react-test-renderer": "^17.0.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"dtslint": "^4.0.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^8.0.0",
"eslint-config-sanity": "^5.0.0",
Expand All @@ -133,18 +132,20 @@
"rollup": "^2.0.0",
"rollup-plugin-node-polyfills": "^0.2.0",
"rollup-plugin-terser": "^7.0.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"uglify-js": "^3.0.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
"build:lib": "rimraf lib/ && babel src/ --quiet --copy-files -d lib/",
"build:ts": "rimraf \"{src/**,lib/**,}.d.ts\" && tsc && type-coverage",
"build:umd": "rollup --silent -c",
"build:umdcheck": "printf 'ES5? ' && uglifyjs react-markdown.min.js > /dev/null && echo 'Yes'",
"build": "run-s build:*",
"format": "remark . -qfo --ignore-pattern test/ && prettier . -w --loglevel warn && eslint . --fix",
"test": "run-s build format test:*",
"test:unit": "jest --coverage",
"test:types": "dtslint ."
"test:unit": "jest --coverage"
},
"browserslist": "> 0.25%, not dead",
"remarkConfig": {
Expand Down Expand Up @@ -175,6 +176,16 @@
"trailingComma": "none",
"useTabs": false
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"strict": true,
"ignoreCatch": true,
"#": "below is ignored because some proptypes will `any`",
"ignoreFiles": [
"src/react-markdown.d.ts"
]
},
"eslintConfig": {
"extends": [
"sanity",
Expand Down

0 comments on commit d27cd59

Please sign in to comment.