Skip to content

Commit 74f4a74

Browse files
authored
Add require jsdoc rule (#73)
1 parent 1e92c82 commit 74f4a74

File tree

5 files changed

+3108
-3577
lines changed

5 files changed

+3108
-3577
lines changed

.eslintrc.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"ecmaVersion": 12,
1818
"sourceType": "module"
1919
},
20-
"plugins": ["react", "@typescript-eslint", "react-hooks", "prettier", "simple-import-sort"],
20+
"plugins": ["react", "@typescript-eslint", "react-hooks", "prettier", "simple-import-sort", "jsdoc"],
2121
"settings": {
2222
"react": {
2323
"version": "latest"
@@ -40,6 +40,15 @@
4040
],
4141
"simple-import-sort/exports": "error",
4242
"@typescript-eslint/no-shadow": ["error"],
43+
"jsdoc/require-jsdoc": 1, // Recommended
44+
"jsdoc/require-param": 1, // Recommended
45+
"jsdoc/require-param-description": 1, // Recommended
46+
"jsdoc/require-param-name": 1, // Recommended
47+
"jsdoc/require-param-type": 1, // Recommended
48+
"jsdoc/require-property": 1, // Recommended
49+
"jsdoc/require-property-description": 1, // Recommended
50+
"jsdoc/require-property-name": 1, // Recommended
51+
"jsdoc/require-property-type": 1, // Recommended
4352
"simple-import-sort/imports": [
4453
"warn",
4554
{

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"eslint-config-prettier": "^8.3.0",
6060
"eslint-import-resolver-typescript": "^2.5.0",
6161
"eslint-plugin-import": "^2.25.4",
62+
"eslint-plugin-jsdoc": "^37.9.4",
6263
"eslint-plugin-prettier": "^4.0.0",
6364
"eslint-plugin-react": "^7.28.0",
6465
"eslint-plugin-react-hooks": "^4.3.0",
@@ -70,7 +71,7 @@
7071
"prettier": "^2.5.1",
7172
"raw-loader": "^4.0.2",
7273
"react-docgen-typescript": "^2.2.2",
73-
"react-styleguidist": "^11.2.0",
74+
"react-styleguidist": "^5.5.10",
7475
"rollup": "^2.63.0",
7576
"rollup-plugin-dts": "^4.1.0",
7677
"rollup-plugin-postcss": "^4.0.2",

src/components/icons/OSIcon/OSIcon.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ export type OSIconProps = {
9090
* The OSIconsEnum is exported with the OSIcon and it represent the possible icons available with this component.
9191
*
9292
* OSIcon use a standard HTML img tag to render the right os image for you.
93+
*
94+
* @param {OSIconProps} props is the parrent props object.
95+
* @param {string} props.iconClass is the name of the OS class.
96+
* @param {string} props.alt is the alt attribute holds a text description of the os icon image.
97+
* @param {string} props.className is additional classes added to the image.
98+
* @param {string} props.width is the intrinsic width of the image. Could be a string or a number of pixels.
99+
* @param {string} props.height is the intrinsic height of the image. Could be a string or a number of pixels.
100+
* @param {string} props.'data-test-id' is a testing id.
93101
* */
94102
export const OSIcon = ({
95103
iconClass,

src/components/utils/ConditionLabel/ConditionLabel.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,21 @@ export interface k8sStatusConditions {
2121
message?: string;
2222
}
2323

24+
export type ConditionLabelProps = {
25+
message?: string;
26+
status: string;
27+
reason: string;
28+
};
29+
2430
/**
2531
* ConditionLabel renders a k8sStatusConditions.
2632
* Usefull to give information of what the resouce is doing without taking up much space into the interface.
2733
*
2834
* On mouse click it creates a popover to explain the state in a more disursive way.
35+
* @param {ConditionLabelProps} props is the parrent props object.
36+
* @param {string} props.message popup message to print when clicking the condition.
37+
* @param {string} props.status the status of the condition.
38+
* @param {string} props.reason the condition id.
2939
*/
3040
export const ConditionLabel: React.FC<k8sStatusConditions> = ({ message, status, reason }) => {
3141
const preventLabelLink = React.useCallback((e) => e.preventDefault(), []);

0 commit comments

Comments
 (0)