-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy patheslint.config.js
More file actions
128 lines (115 loc) · 3.76 KB
/
eslint.config.js
File metadata and controls
128 lines (115 loc) · 3.76 KB
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
124
125
126
127
128
import js from '@eslint/js'
import pluginQuasar from '@quasar/app-vite/eslint'
import prettierSkipFormatting from '@vue/eslint-config-prettier/skip-formatting'
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import importPlugin from 'eslint-plugin-import'
import pluginVue from 'eslint-plugin-vue'
export default [
{
/**
* Ignore the following files.
* Please note that pluginQuasar.configs.recommended already ignores
* the "node_modules" folder for you (and all other Quasar project
* relevant folders and files).
*
* ESLint requires "ignores" key to be the only one in this object
*/
// ignores: []
},
...pluginQuasar.configs.recommended(),
js.configs.recommended,
importPlugin.flatConfigs.recommended,
{
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
},
/**
* https://eslint.vuejs.org
*
* pluginVue.configs.base
* -> Settings and rules to enable correct ESLint parsing.
* pluginVue.configs[ 'flat/essential']
* -> base, plus rules to prevent errors or unintended behavior.
* pluginVue.configs["flat/strongly-recommended"]
* -> Above, plus rules to considerably improve code readability and/or dev experience.
* pluginVue.configs["flat/recommended"]
* -> Above, plus rules to enforce subjective community defaults to ensure consistency.
*/
...pluginVue.configs['flat/essential'],
// https://github.com/vuejs/eslint-config-typescript
...defineConfigWithVueTs(vueTsConfigs.recommended),
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
// add your custom rules here
rules: {
// https://eslint.org/docs/latest/rules/no-undef#handled_by_typescript
// done by ts
'no-undef': 'off',
'prefer-promise-reject-errors': 'off',
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
// allow debugger during development only
'no-debugger': 'error',
'no-console': 'warn',
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
'import/order': [
'warn',
{
'newlines-between': 'always',
groups: ['builtin', 'external', 'internal', 'type'],
pathGroups: [
{
pattern: 'src/utils/**',
group: 'internal',
position: 'before',
},
{
pattern: '{src/,}stores/**',
group: 'internal',
position: 'before',
},
{
pattern: '{src/,}components{/,}**',
group: 'internal',
position: 'before',
},
{
pattern: '{src/,}composition{/,}**',
group: 'internal',
position: 'before',
},
{
pattern: '**/**.css',
group: 'type',
position: 'after',
},
],
pathGroupsExcludedImportTypes: [],
warnOnUnassignedImports: true,
alphabetize: {
order: 'asc',
orderImportKind: 'asc',
caseInsensitive: true,
},
},
],
'import/consistent-type-specifier-style': [2, 'prefer-top-level'],
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-require-imports': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-namespace': 0,
'@typescript-eslint/no-empty-object-type': 0,
'@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true }],
'vue/multi-word-component-names': 0,
'vue/block-lang': 0,
},
},
prettierSkipFormatting,
]