forked from antfu/eslint-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsdoc.ts
41 lines (38 loc) · 1.23 KB
/
jsdoc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { interopDefault } from '../utils'
import type { OptionsStylistic, TypedFlatConfigItem } from '../types'
export async function jsdoc(options: OptionsStylistic = {}): Promise<TypedFlatConfigItem[]> {
const {
stylistic = true,
} = options
return [
{
name: 'antfu/jsdoc/rules',
plugins: {
jsdoc: await interopDefault(import('eslint-plugin-jsdoc')),
},
rules: {
'jsdoc/check-access': 'warn',
'jsdoc/check-param-names': 'warn',
'jsdoc/check-property-names': 'warn',
'jsdoc/check-types': 'warn',
'jsdoc/empty-tags': 'warn',
'jsdoc/implements-on-classes': 'warn',
'jsdoc/no-defaults': 'warn',
'jsdoc/no-multi-asterisks': 'warn',
'jsdoc/require-param-name': 'warn',
'jsdoc/require-property': 'warn',
'jsdoc/require-property-description': 'warn',
'jsdoc/require-property-name': 'warn',
'jsdoc/require-returns-check': 'warn',
'jsdoc/require-returns-description': 'warn',
'jsdoc/require-yields-check': 'warn',
...stylistic
? {
'jsdoc/check-alignment': 'warn',
'jsdoc/multiline-blocks': 'warn',
}
: {},
},
},
]
}