-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
104 lines (102 loc) · 2.73 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
// @ts-check
import eslint from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import perfectionist from 'eslint-plugin-perfectionist'
import * as wdio from 'eslint-plugin-wdio'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
stylistic.configs.customize({
flat: true,
jsx: false,
indent: 2,
quotes: 'single',
semi: false,
commaDangle: 'always-multiline',
braceStyle: '1tbs',
quoteProps: 'as-needed',
}),
{
// Apply `no-console` only to files inside `specific-directory/`
files: ['src/**/*'],
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
},
},
{
rules: {
'@stylistic/curly-newline': ['error', { consistent: true }],
'@stylistic/max-len': ['error', { code: 100, ignoreUrls: true, ignoreComments: true }],
'@stylistic/array-bracket-newline': ['error', 'consistent'],
'@stylistic/array-element-newline': ['error', 'consistent'],
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
'@stylistic/no-confusing-arrow': 'error',
'@stylistic/nonblock-statement-body-position': 'error',
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
'@stylistic/padding-line-between-statements': 'error',
'@stylistic/switch-colon-spacing': 'error',
},
},
{
plugins: {
perfectionist,
},
rules: {
'perfectionist/sort-imports': ['error', {
type: 'natural',
order: 'asc',
ignoreCase: false,
newlinesBetween: 'always',
environment: 'node',
groups: [
'type',
'builtin',
'external',
'internal-type',
'internal',
['parent-type', 'sibling-type', 'index-type'],
['parent', 'sibling', 'index'],
'object',
'unknown',
],
}],
'perfectionist/sort-named-imports': ['error', { order: 'asc', type: 'alphabetical' }],
},
},
{
files: ['**/*.ts'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['**/*.js'],
extends: [
tseslint.configs.disableTypeChecked,
],
languageOptions: {
ecmaVersion: 'latest',
globals: { ...globals.node },
sourceType: 'module',
},
},
{
files: ['e2e/**/*.ts'],
extends: [wdio.configs['flat/recommended']],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
{
ignores: [
'out/*',
'e2e/.e2e_test_vault/*',
],
},
)