-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
45 lines (42 loc) · 1.3 KB
/
index.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
// eslint.config.js
import antfu from '@antfu/eslint-config'
import lodash from 'lodash'
const defaults = {
rules: {
'curly': ['error', 'all'],
'style/max-statements-per-line': ['error', { max: 2 }],
'style/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'ts/consistent-type-definitions': ['error', 'interface'],
'import/order': [
'error',
{
groups: [
'builtin', // Built-in imports (come from NodeJS native) go first
'external', // <- External imports
'internal', // <- Absolute imports
['sibling', 'parent'], // <- Relative imports, the sibling and parent types they can be mingled together
'index', // <- index imports
'unknown', // <- unknown
],
alphabetize: {
/* sort in ascending order. Options: ["ignore", "asc", "desc"] */
order: 'asc',
/* ignore case. Options: [true, false] */
caseInsensitive: true,
},
},
],
},
toml: {
// this helps for cloudflare workers
overrides: {
'toml/inline-table-curly-spacing': 'off',
'toml/array-bracket-newline': 'off',
'toml/padding-line-between-pairs': 'off'
}
}
}
async function eslint(config) {
return antfu(lodash.merge(defaults, config))
}
export default eslint