forked from Fental/univer-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
68 lines (65 loc) · 1.72 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
import antfu from '@antfu/eslint-config'
import tsparser from '@typescript-eslint/parser'
import eslintPluginReadableTailwind from 'eslint-plugin-readable-tailwind'
export default antfu({
ignores: [
'submodules',
'**/submodules/**',
],
typescript: true,
react: true,
regexp: false,
markdown: false,
}, {
files: ['**/*.ts', '**/*.tsx'],
rules: {
'curly': ['error', 'multi-line'],
'antfu/if-newline': 'off',
'style/quote-props': ['error', 'as-needed'],
'style/brace-style': ['warn', '1tbs', { allowSingleLine: true }],
'ts/ban-ts-comment': 'off',
'react-refresh/only-export-components': 'off',
// This rule is from the univer repo.
'ts/naming-convention': [
'warn',
// Interfaces' names should start with a capital 'I'.
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z0-9]',
match: true,
},
},
// Private fields of a class should start with an underscore '_'.
{
selector: ['classMethod', 'classProperty'],
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'require',
},
],
},
languageOptions: {
parser: tsparser,
},
}, {
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'readable-tailwind': eslintPluginReadableTailwind,
},
rules: {
// enable all recommended rules to warn
...eslintPluginReadableTailwind.configs.warning.rules,
// enable all recommended rules to error
...eslintPluginReadableTailwind.configs.error.rules,
// or configure rules individually
'readable-tailwind/multiline': ['warn', { printWidth: 100 }],
},
})