Skip to content

Commit

Permalink
Add types
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Oct 22, 2024
1 parent ee70fc6 commit 6f7f695
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
*.d.ts
*.log
*.map
*.tsbuildinfo
.DS_Store
dest/
node_modules/
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"bugs": "https://github.com/remarkjs/react-markdown/issues",
"contributors": [],
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@wooorm/starry-night": "^3.0.0",
"cssnano": "^7.0.0",
"esbuild": "^0.24.0",
Expand All @@ -26,6 +28,8 @@
"remark-toc": "^9.0.0",
"stylelint": "^16.0.0",
"stylelint-config-standard": "^36.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.59.0"
},
"license": "MIT",
Expand All @@ -48,14 +52,15 @@
"private": true,
"repository": "remarkjs/react-markdown",
"scripts": {
"build": "tsc --build --clean && tsc --build && type-coverage",
"generate:css": "postcss --output dest/index.css -- src/index.css",
"generate:html": "rehype --output dest/ --quiet --use rehype-preset-minify --use rehype-prevent-favicon-request -- src/",
"generate:js:module": "esbuild src/index.js --bundle --conditions=browser,production --define:process.env.NODE_ENV=\\\"production\\\" --format=esm --loader:.js=jsx --log-level=warning --minify --outfile=dest/index.module.js --target=es2020",
"generate:js:nomodule": "esbuild src/index.js --bundle --conditions=browser,production --define:process.env.NODE_ENV=\\\"production\\\" --loader:.js=jsx --log-level=warning --minify --outfile=dest/index.nomodule.js --target=es6",
"generate:js": "npm run generate:js:module && npm run generate:js:nomodule",
"generate": "npm run generate:css && npm run generate:html && npm run generate:js",
"format": "prettier --log-level warn --write -- . && stylelint --fix src/index.css && xo --fix",
"test": "npm run format && npm run build"
"test": "npm run build && npm run format && npm run generate"
},
"stylelint": {
"extends": "stylelint-config-standard"
Expand Down
17 changes: 17 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"checkJs": true,
"customConditions": ["development"],
"declarationMap": true,
"declaration": true,
"emitDeclarationOnly": true,
"exactOptionalPropertyTypes": true,
"jsx": "preserve",
"lib": ["dom", "es2023"],
"module": "node16",
"strict": true,
"target": "es2023"
},
"exclude": ["dest/", "node_modules/"],
"include": ["**/*.js", "**/*.jsx"]
}

0 comments on commit 6f7f695

Please sign in to comment.