diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2024-09-28 22:58:20 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2024-09-28 22:58:28 +0800 |
| commit | e30d7f3e27336258f1027d1c1ae94c3d15668066 (patch) | |
| tree | 9a4bde80785fbd533d0437d3573e1633b73cbf50 | |
| parent | 5c3d2d056018912ccc623a922af9685e4f3d05d6 (diff) | |
chore: add lint for jsdoc
| -rw-r--r-- | eslint.config.js | 12 | ||||
| -rw-r--r-- | package.json | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/eslint.config.js b/eslint.config.js index 8887ce7..7ac6782 100644 --- a/eslint.config.js +++ b/eslint.config.js | |||
| @@ -3,6 +3,7 @@ import js from "@eslint/js"; | |||
| 3 | import importPlugin from "eslint-plugin-import"; | 3 | import importPlugin from "eslint-plugin-import"; |
| 4 | import promisePlugin from "eslint-plugin-promise"; | 4 | import promisePlugin from "eslint-plugin-promise"; |
| 5 | import nodePlugin from "eslint-plugin-node"; | 5 | import nodePlugin from "eslint-plugin-node"; |
| 6 | import jsdoc from 'eslint-plugin-jsdoc'; | ||
| 6 | 7 | ||
| 7 | export default [ | 8 | export default [ |
| 8 | js.configs.recommended, | 9 | js.configs.recommended, |
| @@ -35,5 +36,14 @@ export default [ | |||
| 35 | 'array-callback-return': 'error', | 36 | 'array-callback-return': 'error', |
| 36 | 'no-unexpected-multiline': 'warn', | 37 | 'no-unexpected-multiline': 'warn', |
| 37 | }, | 38 | }, |
| 38 | } | 39 | }, |
| 40 | { | ||
| 41 | files: ['src/*js'], | ||
| 42 | plugins: { | ||
| 43 | jsdoc, | ||
| 44 | }, | ||
| 45 | rules: { | ||
| 46 | 'jsdoc/require-description': 'warn' | ||
| 47 | } | ||
| 48 | }, | ||
| 39 | ]; | 49 | ]; |
diff --git a/package.json b/package.json index 2867ed4..1d84a84 100644 --- a/package.json +++ b/package.json | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | "@rollup/plugin-terser": "^0.4.4", | 39 | "@rollup/plugin-terser": "^0.4.4", |
| 40 | "eslint": "^9.10.0", | 40 | "eslint": "^9.10.0", |
| 41 | "eslint-plugin-import": "^2.30.0", | 41 | "eslint-plugin-import": "^2.30.0", |
| 42 | "eslint-plugin-jsdoc": "^50.3.0", | ||
| 42 | "eslint-plugin-node": "^11.1.0", | 43 | "eslint-plugin-node": "^11.1.0", |
| 43 | "eslint-plugin-promise": "^7.1.0", | 44 | "eslint-plugin-promise": "^7.1.0", |
| 44 | "globals": "^15.9.0", | 45 | "globals": "^15.9.0", |