forked from kodadot/nft-gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
94 lines (94 loc) · 2.49 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
module.exports = {
env: {
browser: true,
es2020: true,
node: true,
},
extends: [
'plugin:vue/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue-scoped-css/recommended',
'prettier',
],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2022,
sourceType: 'module',
},
plugins: ['vue', 'prettier', '@typescript-eslint', 'unicorn'],
rules: {
'no-trailing-spaces': 'error',
'unicorn/no-for-loop': 'error',
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
'no-restricted-syntax': [
'error',
{
selector: 'IfStatement > :not(BlockStatement).consequent',
message: 'Use blockstatement after if, please check STYLE_GUIDE.md',
},
{
selector: 'ForStatement',
message:
'Use `forEach` or `for-of` for loop, please check STYLE_GUIDE.md',
},
],
'no-useless-catch': 1,
'no-var': 'error',
'linebreak-style': 0,
quotes: ['error', 'single'],
semi: ['error', 'never'],
'max-classes-per-file': ['error', 2],
'sort-imports': [
'warn',
{
ignoreDeclarationSort: true,
allowSeparatedGroups: true,
},
],
'vue/multi-word-component-names': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'vue-scoped-css/v-deep-pseudo-style': ['error', ':deep'],
'vue-scoped-css/no-deprecated-deep-combinator': 'error',
'vue-scoped-css/require-v-deep-argument': 'error',
'vue-scoped-css/no-unused-selector': 'off',
'vue-scoped-css/enforce-style-type': 'off',
},
ignorePatterns: ['*.md'],
overrides: [
{
files: [
'layouts/**/*.{js,ts,vue}',
'pages/**/*.vue',
'components/**/*.{js,ts,vue}',
'utils/**/*.ts',
'stores/**/*.ts',
'services/**/*.ts',
'plugins/**/*.ts',
'composables/**/*.ts',
],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: [
'*.png',
'*.jpg',
'*.jpeg',
'*.gif',
'*.bmp',
'*.svg',
'*.webp',
],
message:
'It is recommended to utilize HTML tags and using a URL path, instead of directly importing images using JavaScript',
},
],
},
],
},
},
],
}