Skip to content

Commit b4dd836

Browse files
authored
Add jsdoc linting (#1513)
1 parent b4437e5 commit b4dd836

4 files changed

Lines changed: 285 additions & 11 deletions

File tree

eslint.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import react from 'eslint-plugin-react';
55
import reactHooks from 'eslint-plugin-react-hooks';
66
import globals from 'globals';
77
import mdcs from 'eslint-config-mdcs';
8+
import jsdoc from 'eslint-plugin-jsdoc';
89

910
export default [
1011
// files to ignore
@@ -99,6 +100,38 @@ export default [
99100
},
100101
},
101102

103+
// jsdoc
104+
{
105+
name: 'jsdoc rules',
106+
files: [ '**/*.js', '**/*.jsx' ],
107+
plugins: {
108+
jsdoc,
109+
},
110+
settings: {
111+
jsdoc: {
112+
preferredTypes: {
113+
Any: 'any',
114+
Boolean: 'boolean',
115+
Number: 'number',
116+
object: 'Object',
117+
String: 'string',
118+
},
119+
tagNamePreference: {
120+
returns: 'return',
121+
extends: 'augments',
122+
},
123+
},
124+
},
125+
rules: {
126+
'jsdoc/check-types': 'error',
127+
'jsdoc/require-param-type': 'error',
128+
'jsdoc/require-returns-type': 'error',
129+
'jsdoc/require-returns': 'off',
130+
'jsdoc/require-param-description': 'off',
131+
'jsdoc/require-returns-description': 'off',
132+
},
133+
},
134+
102135
// vitest
103136
{
104137
name: 'vitest rules',

package-lock.json

Lines changed: 243 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"concurrently": "^6.2.1",
101101
"eslint": "^9.0.0",
102102
"eslint-config-mdcs": "^5.0.0",
103+
"eslint-plugin-jsdoc": "^62.8.0",
103104
"eslint-plugin-react": "^7.37.1",
104105
"eslint-plugin-react-hooks": "^5.0.0",
105106
"globals": "^16.5.0",

0 commit comments

Comments
 (0)