-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
84 lines (83 loc) · 2.1 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* eslint n/no-unpublished-import: 0 */
import js from '@eslint/js';
import jsdocPlugin from 'eslint-plugin-jsdoc';
import nodePlugin from 'eslint-plugin-n';
import unicornPlugin from 'eslint-plugin-unicorn';
import globals from 'globals';
/** @type { import('eslint').Linter.Config[] } */
export default [
{
ignores: [
'.github/**/*.*',
'.idea/**/*.*',
'.vscode/**/*.*',
'build/**/*.*',
'coverage/**/*.*',
'dist/**/*.*',
'public/**/*.*',
'types/**/*.*',
'node_modules/**/*.*',
],
},
{
languageOptions: {
globals: {
...globals.jest,
...globals.browser,
...globals.node,
...globals.es2021,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
plugins: {
jsdoc: jsdocPlugin,
n: nodePlugin,
unicorn: unicornPlugin,
},
settings: {
'import/parsers': {
espree: ['.js', '.cjs', '.mjs', '.jsx'],
},
'import/resolver': {
node: true,
},
},
rules: {
...js.configs.recommended.rules,
...jsdocPlugin.configs['flat/recommended'].rules,
...nodePlugin.configs.recommended.rules,
'no-unused-vars': 'off',
'prefer-arrow-callback': 'warn',
'prefer-template': 'warn',
'jsdoc/require-jsdoc': [
'warn',
{
require: {
FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: false,
ArrowFunctionExpression: false,
FunctionExpression: false,
},
},
],
'jsdoc/check-indentation': 1,
'jsdoc/check-line-alignment': 1,
'jsdoc/check-syntax': 1,
'jsdoc/require-asterisk-prefix': 1,
'jsdoc/require-description': 1,
'jsdoc/require-description-complete-sentence': 1,
'jsdoc/require-hyphen-before-param-description': 1,
'jsdoc/require-throws': 1,
'jsdoc/sort-tags': 1,
'jsdoc/no-undefined-types': 0,
},
},
];