-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
116 lines (110 loc) · 3.77 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
import antfu from '@antfu/eslint-config';
const baseRules = {
curly: ['error', 'multi-line'],
'no-empty-function': ['error'],
'eol-last': ['error', 'always'],
'import/no-self-import': 'error',
'ts/no-explicit-any': 'warn',
'style/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }],
'style/brace-style': ['warn', '1tbs', { allowSingleLine: true }],
'style/comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
enums: 'always-multiline',
functions: 'never',
}],
'no-empty-function': 'off',
'style/arrow-parens': ['error', 'always'],
'ts/no-redeclare': 'off',
'antfu/if-newline': 'off',
'style/spaced-comment': 'off',
'tunicorn/number-literal-case': 'off',
'style/indent-binary-ops': 'off',
'ts/method-signature-style': 'off',
'style/indent': ['error', 4, {
ObjectExpression: 'first',
SwitchCase: 1,
ignoreComments: true,
}],
'sort-imports': [
'error',
{
allowSeparatedGroups: false,
// ignoreCase: false,
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
// 'react/no-unstable-context-value': 'warn',
// 'react/no-unstable-default-props': 'warn',
'command/command': 'off',
// TODO: debatable rules
'test/prefer-lowercase-title': 'off',
'antfu/top-level-function': 'off',
'style/operator-linebreak': 'off',
'unicorn/no-new-array': 'off',
'unicorn/prefer-includes': 'off',
'prefer-arrow-callback': 'off',
'no-restricted-globals': 'off',
'unicorn/prefer-string-starts-ends-with': 'warn',
// TODO: just for compatibility with old code
'unused-imports/no-unused-vars': 'warn',
'style/jsx-closing-tag-location': 'warn',
'ts/ban-types': 'warn',
'unicorn/prefer-dom-node-text-content': 'warn',
'unicorn/prefer-number-properties': 'warn',
'no-prototype-builtins': 'warn',
'style/no-tabs': 'warn',
'style/quotes': ['warn', 'single', { avoidEscape: true }],
// 'react/display-name': 'off',
// 'react-hooks/rules-of-hooks': 'off',
'eslint-comments/no-unlimited-disable': 'off',
'ts/prefer-ts-expect-error': 'off',
'ts/ban-ts-comment': 'off',
'ts/no-duplicate-enum-values': 'off',
'no-cond-assign': 'warn',
'antfu/consistent-list-newline': 'off',
'ts/no-use-before-define': 'warn',
'intunicorn/number-literal-case': 'off',
'test/no-identical-title': 'warn',
'ts/no-non-null-asserted-optional-chain': 'warn',
'no-restricted-syntax': 'warn',
'prefer-regex-literals': 'warn',
'ts/no-this-alias': 'warn',
'prefer-promise-reject-errors': 'warn',
'no-new': 'warn',
'unicorn/error-message': 'warn',
'ts/prefer-literal-enum-member': 'warn',
'style/jsx-curly-newline': ['warn', { multiline: 'forbid', singleline: 'forbid' }],
'no-control-regex': 'warn',
'style/jsx-wrap-multilines': 'warn',
'ts/no-import-type-side-effects': 'warn',
'style/quote-props': ['warn', 'as-needed'],
'unicorn/number-literal-case': 'warn',
// 'react/no-direct-mutation-state': 'warn',
'style/jsx-curly-brace-presence': 'warn',
'style/multiline-ternary': 'warn',
'unicorn/prefer-type-error': 'warn',
'accessor-pairs': 'warn',
};
const ignores = [
'submodules/univer-scraper-shared/*',
];
export default antfu({
ignores,
typescript: true,
stylistic: {
indent: 4,
semi: true,
},
rules: baseRules,
yaml: {
overrides: {
'yaml/indent': ['error', 4, { indicatorValueIndent: 2 }],
},
},
});