-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
103 lines (102 loc) · 2.59 KB
/
.eslintrc.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
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution');
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'@vue/eslint-config-typescript/recommended',
'plugin:unicorn/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'@vue/eslint-config-prettier',
],
rules: {
'@typescript-eslint/consistent-type-imports': 2,
'@typescript-eslint/no-unused-vars': [
'error',
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true },
],
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/no-redeclare': ['error', { ignoreDeclarationMerge: false }],
'import/order': [
'error',
{
groups: ['type', 'builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'import/no-unresolved': ['error', { ignore: ['virtual:'] }],
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['.*'],
message: "Don't use relative imports",
},
],
},
],
'unicorn/no-null': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/text-encoding-identifier-case': 'off',
'unicorn/filename-case': 'off',
'unicorn/expiring-todo-comments ': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/no-unreadable-array-destructuring': 'off',
'unicorn/no-unreadable-iife': 'off',
'unicorn/no-unsafe-regex': 'error',
'unicorn/prefer-query-selector': 'off',
'unicorn/prefer-type-error': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/no-keyword-prefix': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'always',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/padding-line-between-blocks': ['error', 'always'],
'vue/no-setup-props-destructure': 'off',
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
overrides: [
{
files: ['*.vue'],
globals: {
$ref: 'readonly',
$computed: 'readonly',
$shallowRef: 'readonly',
$customRef: 'readonly',
$toRef: 'readonly',
$$: 'readonly',
$: 'readonly',
},
},
],
};