Skip to content

Commit 39dcc66

Browse files
committed
docs(ESLint): gen docs with ESLint plugin reference
1 parent 502eb7b commit 39dcc66

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules/
22
dist/
33
*.log
44
coverage/
5-
docs/
5+
docs/
6+
pageDocs/

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"build": "tsc && prettier --check 'dist/**/*' --write",
2323
"test": "jest --coverage",
2424
"lint": "eslint --ext=.ts,.tsx --max-warnings=0 src/ && prettier --check 'src/**/*'",
25-
"docs": "typedoc --out docs/$npm_package_version && scripts/gen-docs-index.sh $npm_package_version"
25+
"docs": "scripts/gen-docs.sh $npm_package_version"
2626
},
2727
"main": "dist/index.js",
2828
"types": "dist/index.d.ts",
@@ -52,6 +52,7 @@
5252
"react-test-renderer": "^16.9.0",
5353
"ts-jest": "^24.1.0",
5454
"typedoc": "^0.15.0",
55+
"typedoc-plugin-markdown-pages": "^0.3.0",
5556
"typescript": "^3.6.3"
5657
}
5758
}

scripts/gen-docs-index.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

scripts/gen-docs.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
PKG_VERSION=$1
4+
5+
mkdir pageDocs && ln -sf ../eslint-plugin/README.md pageDocs/EslintPlugin.md
6+
7+
yarn run typedoc --out "docs/${PKG_VERSION}"
8+
9+
echo "<meta http-equiv='refresh' content='0; URL=\"${PKG_VERSION}/index.html\"' />;" > docs/index.html
10+
11+
rm -rf pageDocs

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
},
1313
"typedocOptions": {
1414
"exclude": "src/__tests__/**/*",
15-
"out": "docs"
15+
"out": "docs",
16+
"mdPagesSourcePath": "pageDocs",
17+
"theme": "markdown-pages"
1618
}
1719
}

yarn.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@
459459
rimraf "^2.5.2"
460460

461461
"@react-hook-utilities/eslint-plugin@./eslint-plugin":
462-
version "1.0.0"
462+
version "0.1.0"
463463

464464
"@testing-library/react-hooks@^2.0.1":
465465
version "2.0.1"
@@ -4766,6 +4766,11 @@ typedoc-default-themes@^0.6.0:
47664766
lunr "^2.3.6"
47674767
underscore "^1.9.1"
47684768

4769+
typedoc-plugin-markdown-pages@^0.3.0:
4770+
version "0.3.0"
4771+
resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown-pages/-/typedoc-plugin-markdown-pages-0.3.0.tgz#17f0f9ff3aa312e9ed142eb15ea216ea95d5fb5f"
4772+
integrity sha512-QVWs6eL0BEOiRgJm6wRRgE8kESFv85HlefLv14ZbMM2VQ1HqErVeT9ukbhkYMznsD/juAsX3Xc5M+Ju7/ZDq4Q==
4773+
47694774
typedoc@^0.15.0:
47704775
version "0.15.0"
47714776
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.15.0.tgz#21eaf4db41cf2797bad027a74f2a75cd08ae0c2d"

0 commit comments

Comments
 (0)