-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
151 lines (147 loc) · 4.94 KB
/
Copy patheslint.config.js
File metadata and controls
151 lines (147 loc) · 4.94 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// eslint.config.js
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable jsdoc/require-jsdoc */
/* eslint-disable @typescript-eslint/naming-convention */
import globals from 'globals';
import tseslint from 'typescript-eslint';
import tsParser from '@typescript-eslint/parser';
import jsdoc from 'eslint-plugin-jsdoc';
import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
export default [
{
ignores: ['eslint.config.js'],
},
// Plugins
eslint.configs.recommended,
tseslint.configs.eslintRecommended,
...tseslint.configs.recommendedTypeChecked,
jsdoc.configs['flat/recommended'],
eslintConfigPrettier,
// /Plugins
{
languageOptions: {
globals: {
...globals.es2021,
...globals.node,
},
parser: tsParser,
parserOptions: {
sourceType: 'module',
project: ['tsconfig.json'],
},
},
plugins: {
'@typescript-eslint/eslint-plugin': tseslint,
'eslint-plugin-jsdoc': jsdoc,
},
rules: {
'unicode-bom': ['error', 'never'],
'@typescript-eslint/explicit-function-return-type': 'warn',
'no-var': 'off',
'no-restricted-syntax': [
'error',
{
selector: 'VariableDeclaration[kind=\'var\'][declare!=true]',
message: 'Unexpected var, use let or const instead.',
},
],
eqeqeq: 'warn',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'spaced-comment': ['warn', 'always'],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
},
{
selector: 'parameter',
format: ['camelCase'],
leadingUnderscore: 'allow',
},
{
selector: 'memberLike',
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'require',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: [
'classProperty',
'objectLiteralProperty',
'typeProperty',
'classMethod',
'objectLiteralMethod',
'typeMethod',
'accessor',
'enumMember',
],
format: null,
modifiers: ['requiresQuotes'],
},
],
'jsdoc/check-param-names': [
'error',
{
checkDestructured: false,
},
],
'jsdoc/require-param': [
'error',
{
checkDestructured: false,
},
],
'jsdoc/require-param-description': 'error',
'jsdoc/require-returns': 'error',
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/require-jsdoc': [
'error',
{
publicOnly: true,
require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true,
},
contexts: [
'ArrowFunctionExpression',
'FunctionDeclaration',
'FunctionExpression',
'MethodDefinition',
'Property',
'TSDeclareFunction',
'TSEnumDeclaration',
'TSInterfaceDeclaration',
'TSMethodSignature',
'TSPropertySignature',
'TSTypeAliasDeclaration',
'VariableDeclaration',
],
},
],
},
}
];