-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
.eslintrc.js
123 lines (112 loc) · 2.98 KB
/
.eslintrc.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
},
extends: [
// 'airbnb-base',
'@antfu',
'plugin:vue/vue3-recommended',
'plugin:import/recommended',
'plugin:@typescript-eslint/recommended',
],
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: [
'vue',
'@typescript-eslint',
],
ignorePatterns: ['node_modules/*', 'dist/*', '*.yaml', '*.yml', '*.json', '*.md'],
rules: {
// we don't want it
'semi': ['error', 'never'],
// add parens ony when required in arrow function
'arrow-parens': ['error', 'as-needed'],
// add new line above comment
'newline-before-return': 'error',
// Allow multi line string
'no-multi-str': 'off',
// add new line above comment
'lines-around-comment': [
'error',
{
beforeBlockComment: true,
beforeLineComment: true,
allowBlockStart: true,
allowClassStart: true,
allowObjectStart: true,
allowArrayStart: true,
},
],
'vue/custom-event-name-casing': ['error', 'camelCase', {
ignores: [
'/^(click):[a-z]+[a-zA-Z]+$/',
],
}],
'vue/component-name-in-template-casing': ['error', 'PascalCase', {
registeredComponentsOnly: false,
ignores: [],
}],
// Vue
'vue/require-default-prop': 'off',
'vue/no-restricted-class': ['error', '/^(p|m)(l|r)-/', '/^font-(100|200|700|800|900|bold|black)$/'],
'vue/no-required-prop-with-default': 'error',
'vue/v-on-event-hyphenation': ['error', 'never'],
'vue/first-attribute-linebreak': ['error', {
singleline: 'beside',
multiline: 'below',
}],
'vue/require-name-property': 'error',
'vue/component-definition-name-casing': 'error',
'vue/no-duplicate-attr-inheritance': 'error',
'vue/match-component-file-name': ['error', {
extensions: ['vue', 'tsx'],
}],
// 'vue/require-prop-comment': ['error', {
// type: 'JSDoc',
// }],
// Plugin: eslint-plugin-import
'import/prefer-default-export': 'off',
// Plugin: eslint-plugin-import
// For omitting extension for ts files
// 'import/extensions': [
// 'error',
// 'ignorePackages',
// {
// js: 'never',
// jsx: 'never',
// ts: 'never',
// tsx: 'never',
// },
// ],
// ℹ️ Temporary disabled rules
'import/extensions': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
// Ignore _ as unused variable
'@typescript-eslint/no-unused-vars': [
'error', {
varsIgnorePattern: '^_+$',
argsIgnorePattern: '^_+$',
},
],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: 'tsconfig.json',
},
},
},
}