Skip to content

Commit

Permalink
docs(ESLint): gen docs with ESLint plugin reference
Browse files Browse the repository at this point in the history
  • Loading branch information
fjcaetano committed Oct 1, 2019
1 parent 502eb7b commit 39dcc66
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules/
dist/
*.log
coverage/
docs/
docs/
pageDocs/
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"build": "tsc && prettier --check 'dist/**/*' --write",
"test": "jest --coverage",
"lint": "eslint --ext=.ts,.tsx --max-warnings=0 src/ && prettier --check 'src/**/*'",
"docs": "typedoc --out docs/$npm_package_version && scripts/gen-docs-index.sh $npm_package_version"
"docs": "scripts/gen-docs.sh $npm_package_version"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -52,6 +52,7 @@
"react-test-renderer": "^16.9.0",
"ts-jest": "^24.1.0",
"typedoc": "^0.15.0",
"typedoc-plugin-markdown-pages": "^0.3.0",
"typescript": "^3.6.3"
}
}
5 changes: 0 additions & 5 deletions scripts/gen-docs-index.sh

This file was deleted.

11 changes: 11 additions & 0 deletions scripts/gen-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

PKG_VERSION=$1

mkdir pageDocs && ln -sf ../eslint-plugin/README.md pageDocs/EslintPlugin.md

yarn run typedoc --out "docs/${PKG_VERSION}"

echo "<meta http-equiv='refresh' content='0; URL=\"${PKG_VERSION}/index.html\"' />;" > docs/index.html

rm -rf pageDocs
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
},
"typedocOptions": {
"exclude": "src/__tests__/**/*",
"out": "docs"
"out": "docs",
"mdPagesSourcePath": "pageDocs",
"theme": "markdown-pages"
}
}
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@
rimraf "^2.5.2"

"@react-hook-utilities/eslint-plugin@./eslint-plugin":
version "1.0.0"
version "0.1.0"

"@testing-library/react-hooks@^2.0.1":
version "2.0.1"
Expand Down Expand Up @@ -4766,6 +4766,11 @@ typedoc-default-themes@^0.6.0:
lunr "^2.3.6"
underscore "^1.9.1"

typedoc-plugin-markdown-pages@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown-pages/-/typedoc-plugin-markdown-pages-0.3.0.tgz#17f0f9ff3aa312e9ed142eb15ea216ea95d5fb5f"
integrity sha512-QVWs6eL0BEOiRgJm6wRRgE8kESFv85HlefLv14ZbMM2VQ1HqErVeT9ukbhkYMznsD/juAsX3Xc5M+Ju7/ZDq4Q==

typedoc@^0.15.0:
version "0.15.0"
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.15.0.tgz#21eaf4db41cf2797bad027a74f2a75cd08ae0c2d"
Expand Down

0 comments on commit 39dcc66

Please sign in to comment.