-
Notifications
You must be signed in to change notification settings - Fork 6
/
eslint.config.mjs
50 lines (49 loc) · 1.46 KB
/
eslint.config.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import pluginJs from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import jsdoc from 'eslint-plugin-jsdoc';
import globals from 'globals';
export default [
// @see https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores
{
files: ['src/**/*.mjs'],
plugins: {
jsdoc: jsdoc,
},
languageOptions: { globals: globals.node },
rules: {
'jsdoc/check-alignment': 'error',
'jsdoc/check-indentation': 'error',
'jsdoc/require-jsdoc': [
'error',
{
require: {
FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: true,
ArrowFunctionExpression: true,
FunctionExpression: true,
},
},
],
'jsdoc/require-param': 'error',
},
},
// Override rules for test files to disable JSDoc rules
{
files: ['src/**/*.test.mjs'],
rules: {
'jsdoc/check-alignment': 'off',
'jsdoc/check-indentation': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
},
},
// @see https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores
{
files: ['src/generators/legacy-html/assets/*.js'],
languageOptions: { globals: { ...globals.browser } },
},
// @see https://eslint.org/docs/latest/rules to learn more about these rules
pluginJs.configs.recommended,
eslintConfigPrettier,
];