-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
98 lines (94 loc) · 2.94 KB
/
eslint.config.mjs
File metadata and controls
98 lines (94 loc) · 2.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
import { globalIgnores } from '@eslint/config-helpers';
import EslintConfigPrettier from 'eslint-config-prettier/flat';
import EslintPluginReactHooks from 'eslint-plugin-react-hooks';
import neostandard from 'neostandard';
import tseslint from 'typescript-eslint';
export default tseslint.config(
globalIgnores(['.work/', 'dist/', '**/*.d.ts']),
...neostandard({
ts: true,
env: ['node'],
semi: true,
}),
tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: {
defaultProject: 'tsconfig.json',
allowDefaultProject: ['*.mjs', '*.cjs'],
},
},
},
plugins: { 'react-hooks': EslintPluginReactHooks },
rules: {
camelcase: 'off',
'lines-between-class-members': 'off',
'no-dupe-class-members': 'off',
'no-useless-constructor': 'off',
'no-void': ['error', { allowAsStatement: true }],
'import-x/export': 'off',
'import-x/order': [
'error',
{
'newlines-between': 'never',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
},
{
selector: 'typeLike',
format: ['PascalCase'],
leadingUnderscore: 'allow',
},
{
selector: 'memberLike',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allowSingleOrDouble',
trailingUnderscore: 'allowSingleOrDouble',
},
{ selector: 'memberLike', modifiers: ['requiresQuotes'], format: null },
{ selector: 'import', format: null },
{
selector: 'variableLike',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allowSingleOrDouble',
trailingUnderscore: 'allowSingleOrDouble',
},
],
'@typescript-eslint/no-empty-function': [
'error',
{ allow: ['protected-constructors', 'private-constructors'] },
],
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['**/*.mjs', '**/*.cjs'],
extends: [tseslint.configs.disableTypeChecked],
},
{
files: ['**/*.cjs'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
EslintConfigPrettier
);