-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.cjs
123 lines (122 loc) · 2.35 KB
/
eslint.config.cjs
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
const antfu = require('@antfu/eslint-config').default
const { GLOB_CSS, GLOB_POSTCSS } = require('@antfu/eslint-config')
module.exports = antfu(
{
stylistic: {
'indent': 'tab',
'max-len': [2, 80, 2],
},
ignores: [
'**/*.svg',
'**/*.snap',
'**/*.mdx',
'**/Turf.js',
'**/*.js',
'**/*.typegen.ts',
'**/.auth/',
'**/db/src/lib/test',
'**/public',
'**/playwright-report',
'**/*.rxdb.ts',
'./artifact',
'./coverage',
'./dist',
'./node_modules',
],
formatters: {
/**
* Format CSS, LESS, SCSS files, also the `<style>` blocks in Vue
* By default uses Prettier
*/
css: true,
/**
* Format HTML files
* By default uses Prettier
*/
html: true,
/**
* Format Markdown files
* Supports Prettier and dprint
* By default uses Prettier
*/
markdown: 'prettier',
},
},
{
rules: {
'no-console': 'off',
'antfu/if-newline': 'off',
'style/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'curly': [2, 'multi-line', 'consistent'],
'accessor-pairs': 'off',
},
},
{
files: ['**/*'],
rules: {
'import/order': ['off'],
'antfu/no-top-level-await': 'off',
'ts/no-unused-expressions': 'off', // @TODO: fix the relevant code points
'perfectionist/sort-imports': [
'error',
{
type: 'natural',
order: 'asc',
groups: [
[
'type',
'primevue-type',
'internal-type',
'parent-type',
'sibling-type',
'index-type',
],
['builtin', 'external'],
'primevue',
['internal', 'parent', 'sibling', 'index'],
'side-effect',
'style',
'object',
'unknown',
],
customGroups: {
value: {
primevue: ['primevue/**'],
},
type: {
'primevue-type': ['primevue/**'],
},
},
newlinesBetween: 'always',
},
],
},
},
{
files: ['**/*.ts'],
rules: {
'ts/consistent-type-definitions': ['error', 'type'],
},
},
{
files: ['**/*.vue'],
rules: {
'no-unused-vars': 'off',
'unused-imports/no-unused-vars': 'off',
'ts/no-unused-vars': 'off',
'vue/no-template-shadow': 'off', // primevue components have a lot of shadowed variables
},
},
{
files: [GLOB_CSS, GLOB_POSTCSS],
rules: {
'format/prettier': [
'error',
{
useTabs: true,
parser: 'css',
},
],
},
},
)