-
Notifications
You must be signed in to change notification settings - Fork 593
/
eslint.config-full.mjs
36 lines (35 loc) · 1.28 KB
/
eslint.config-full.mjs
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
import eslintConfig from './eslint.config.mjs';
import jsdoc from 'eslint-plugin-jsdoc';
export default [
...eslintConfig,
jsdoc.configs['flat/recommended-typescript-flavor'],
{
plugins: {
jsdoc
},
settings: {
jsdoc: {
// 1. jsdoc gives an error for index signatures as type:
// {[key: string]: {red: number[], green: number[], blue: number[]}}
// -> ERROR: Unable to parse a tag's type expression for source file ...
// Invalid type expression
// 2. in typescript mode, eslint/jsdoc 'check-types'
// gives a warning when using: Object<>
// -> Use object shorthand or index signatures instead of `Object`,
// e.g., `{[key: string]: string}`
// => adding Object to preferredTypes removes the warning
preferredTypes: {
Object: 'Object'
}
}
},
rules: {
// tag lines
// https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/tag-lines.md#readme
'jsdoc/tag-lines': ['error', 'any', {startLines: 1}],
// require description complete sentence
// https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/require-description-complete-sentence.md
'jsdoc/require-description-complete-sentence': ['error']
}
}
];