-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
66 lines (65 loc) · 1.78 KB
/
eslint.config.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const eslint = require('@eslint/js');
const eslintConfigGoogle = require('eslint-config-google');
const babelEslintParser = require('@babel/eslint-parser');
const globals = require('globals');
const jsdoc = require('eslint-plugin-jsdoc');
module.exports = [
eslint.configs.recommended,
eslintConfigGoogle,
jsdoc.configs['flat/recommended'],
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parser: babelEslintParser,
parserOptions: {
requireConfigFile: false,
},
globals: {
...globals.node,
...globals.mocha,
_: 'readonly',
},
},
plugins: {
jsdoc: jsdoc,
},
rules: {
'arrow-parens': ['error', 'as-needed'],
'max-len': ['error', {
code: 120,
ignoreComments: true,
}],
// Disable the deprecated 'require-jsdoc' rule
'require-jsdoc': 'off',
// Use the jsdoc/require-jsdoc rule instead
'jsdoc/require-jsdoc': ['error', {
require: {
FunctionDeclaration: true,
MethodDefinition: false,
ClassDeclaration: false,
ArrowFunctionExpression: false,
FunctionExpression: false,
},
}],
// Disable the deprecated 'valid-jsdoc' rule from google's config
'valid-jsdoc': 'off',
// Configure jsdoc rules to mimic 'valid-jsdoc'
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns-description': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/tag-lines': 'off',
'jsdoc/check-tag-names': ['error', {
definedTags: ['returns'],
}],
'jsdoc/check-param-names': 'error',
'jsdoc/check-types': 'error',
'jsdoc/valid-types': 'error',
},
},
{
ignores: [
'docs/.vitepress/cache/',
],
},
];