-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
121 lines (120 loc) · 3.73 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import js from '@eslint/js';
import jsdocPlugin from 'eslint-plugin-jsdoc';
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,
unicorn: unicornPlugin,
},
settings: {
'import/parsers': {
espree: ['.js', '.cjs', '.mjs', '.jsx'],
},
'import/resolver': {
node: true,
},
},
rules: {
...js.configs.recommended.rules,
...jsdocPlugin.configs['flat/recommended'].rules,
...unicornPlugin.configs['flat/recommended'].rules,
'no-unused-vars': 'off',
'prefer-arrow-callback': 'warn',
'prefer-template': 'warn',
'unicorn/consistent-function-scoping': 'off',
'unicorn/explicit-length-check': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-push-push': 'off',
'unicorn/no-for-loop': 'off',
'unicorn/no-lonely-if': 'off',
'unicorn/no-negated-condition': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/no-null': 'off',
'unicorn/no-this-assignment': 'off',
'unicorn/no-typeof-undefined': 'off',
'unicorn/no-undefined': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/number-literal-case': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-add-event-listener': 'off',
'unicorn/prefer-at': 'off',
'unicorn/prefer-code-point': 'off',
'unicorn/prefer-default-parameters': 'off',
'unicorn/prefer-dom-node-append': 'off',
'unicorn/prefer-dom-node-remove': 'off',
'unicorn/prefer-global-this': 'off',
'unicorn/prefer-includes': 'off',
'unicorn/prefer-logical-operator-over-ternary': 'off',
'unicorn/prefer-math-min-max': 'off',
'unicorn/prefer-math-trunc': 'off',
'unicorn/prefer-modern-dom-apis': 'off',
'unicorn/prefer-modern-math-apis': 'off',
'unicorn/prefer-optional-catch-binding': 'off',
'unicorn/prefer-query-selector': 'off',
'unicorn/prefer-regexp-test': 'off',
'unicorn/prefer-spread': 'off',
'unicorn/prefer-string-replace-all': 'off',
'unicorn/prefer-string-slice': 'off',
'unicorn/prefer-structured-clone': 'off',
'unicorn/prefer-switch': 'off',
'unicorn/prefer-ternary': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/switch-case-braces': 'off',
'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,
},
},
];