@@ -9,6 +9,8 @@ module.exports = {
9
9
'plugin:import/recommended' ,
10
10
'plugin:promise/recommended' ,
11
11
'plugin:sonarjs/recommended' ,
12
+ 'plugin:case-police/recommended' ,
13
+ 'plugin:regexp/recommended' ,
12
14
13
15
// 'plugin:unicorn/recommended',
14
16
] ,
@@ -20,15 +22,18 @@ module.exports = {
20
22
plugins : [
21
23
'vue' ,
22
24
'regex' ,
25
+ 'regexp' ,
23
26
] ,
24
- ignorePatterns : [ 'src/@ iconify/*.js' , 'node_modules' , 'dist' ] ,
27
+ ignorePatterns : [ 'src/plugins/ iconify/*.js' , 'node_modules' , 'dist' , '*.d.ts' , 'vendor' , '*.json '] ,
25
28
rules : {
26
29
'no-console' : process . env . NODE_ENV === 'production' ? 'warn' : 'off' ,
27
30
'no-debugger' : process . env . NODE_ENV === 'production' ? 'warn' : 'off' ,
28
31
29
32
// indentation (Already present in TypeScript)
30
33
'comma-spacing' : [ 'error' , { before : false , after : true } ] ,
31
34
'key-spacing' : [ 'error' , { afterColon : true } ] ,
35
+ 'n/prefer-global/process' : [ 'off' ] ,
36
+ 'sonarjs/cognitive-complexity' : [ 'off' ] ,
32
37
33
38
'vue/first-attribute-linebreak' : [ 'error' , {
34
39
singleline : 'beside' ,
@@ -45,6 +50,9 @@ module.exports = {
45
50
// Enforce consistent spacing inside braces of object (Already present in TypeScript)
46
51
'object-curly-spacing' : [ 'error' , 'always' ] ,
47
52
53
+ // Enforce camelCase naming convention
54
+ 'camelcase' : 'error' ,
55
+
48
56
// Disable max-len
49
57
'max-len' : 'off' ,
50
58
@@ -67,6 +75,9 @@ module.exports = {
67
75
allowClassStart : true ,
68
76
allowObjectStart : true ,
69
77
allowArrayStart : true ,
78
+
79
+ // We don't want to add extra space above closing SECTION
80
+ ignorePattern : '!SECTION' ,
70
81
} ,
71
82
] ,
72
83
@@ -88,7 +99,10 @@ module.exports = {
88
99
// Plugin: eslint-plugin-import
89
100
'import/prefer-default-export' : 'off' ,
90
101
'import/newline-after-import' : [ 'error' , { count : 1 } ] ,
91
- 'no-restricted-imports' : [ 'error' , 'vuetify/components' ] ,
102
+ 'no-restricted-imports' : [ 'error' , 'vuetify/components' , {
103
+ name : 'vue3-apexcharts' ,
104
+ message : 'apexcharts are auto imported' ,
105
+ } ] ,
92
106
93
107
// For omitting extension for ts files
94
108
'import/extensions' : [
@@ -107,6 +121,8 @@ module.exports = {
107
121
ignore : [
108
122
'~pages$' ,
109
123
'virtual:generated-layouts' ,
124
+ '#auth$' ,
125
+ '#components$' ,
110
126
111
127
// Ignore vite's ?raw imports
112
128
'.*\?raw' ,
@@ -124,7 +140,7 @@ module.exports = {
124
140
// ESLint plugin vue
125
141
'vue/block-tag-newline' : 'error' ,
126
142
'vue/component-api-style' : 'error' ,
127
- 'vue/component-name-in-template-casing' : [ 'error' , 'PascalCase' , { registeredComponentsOnly : false } ] ,
143
+ 'vue/component-name-in-template-casing' : [ 'error' , 'PascalCase' , { registeredComponentsOnly : false , ignores : [ '/^swiper-/' ] } ] ,
128
144
'vue/custom-event-name-casing' : [ 'error' , 'camelCase' , {
129
145
ignores : [
130
146
'/^(click):[a-z]+((\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?/' ,
@@ -138,8 +154,7 @@ module.exports = {
138
154
'vue/no-child-content' : 'error' ,
139
155
'vue/require-default-prop' : 'off' ,
140
156
141
- // NOTE this rule only supported in SFC, Users of the unplugin-vue-define-options should disable that rule: https://github.com/vuejs/eslint-plugin-vue/issues/1886
142
- // 'vue/no-duplicate-attr-inheritance': 'error',
157
+ 'vue/no-duplicate-attr-inheritance' : 'error' ,
143
158
'vue/no-empty-component-block' : 'error' ,
144
159
'vue/no-multiple-objects-in-class' : 'error' ,
145
160
'vue/no-reserved-component-names' : 'error' ,
@@ -171,6 +186,8 @@ module.exports = {
171
186
// },
172
187
// }],
173
188
189
+ // Internal Rules
190
+
174
191
// https://github.com/gmullerb/eslint-plugin-regex
175
192
'regex/invalid' : [
176
193
'error' ,
@@ -181,16 +198,16 @@ module.exports = {
181
198
message : 'Use \'@images\' path alias for image imports' ,
182
199
} ,
183
200
{
184
- regex : '@/styles' ,
201
+ regex : '@/assets/ styles' ,
185
202
replacement : '@styles' ,
186
- message : 'Use \'@styles\' path alias for importing styles from \'src/styles\'' ,
203
+ message : 'Use \'@styles\' path alias for importing styles from \'src/assets/ styles\'' ,
187
204
} ,
188
205
189
- // {
190
- // id: 'Disallow icon of icon library',
191
- // regex: 'tabler-\\w',
192
- // message: 'Only \'mdi\' icons are allowed',
193
- // },
206
+ {
207
+ id : 'Disallow icon of icon library' ,
208
+ regex : 'tabler-\\w' ,
209
+ message : 'Only \'mdi\' icons are allowed' ,
210
+ } ,
194
211
195
212
{
196
213
regex : '@core/\\w' ,
@@ -206,25 +223,16 @@ module.exports = {
206
223
inspect : '^(?!.*(@core|@layouts)).*' ,
207
224
} ,
208
225
} ,
209
- {
210
- regex : 'import axios from \'axios\'' ,
211
- replacement : 'import axios from \'@axios\'' ,
212
- message : 'Use axios instances created in \'src/plugin/axios.js\' instead of unconfigured axios' ,
213
- files : {
214
- ignore : '^.*plugins/axios.js.*' ,
215
- } ,
216
- } ,
217
226
] ,
218
227
219
228
// Ignore files
220
- '\.eslintrc\.js ' ,
229
+ '\.eslintrc\.cjs ' ,
221
230
] ,
222
231
} ,
223
232
settings : {
224
233
'import/resolver' : {
225
- node : {
226
- extensions : [ '.js' , '.js' , '.jsx' , '.jsx' , '.mjs' , '.png' , '.jpg' ] ,
227
- } , alias : { 'extensions' : [ '.ts' , '.js' , '.tsx' , '.jsx' , '.mjs' ] , 'map' : [ [ "@" , "./src" ] , [ "@core" , "./src/@core" ] , [ "@layouts" , "./src/@layouts" ] , [ "@images" , "./src/assets/images/" ] , [ "@styles" , "./src/styles/" ] , [ "@configured-variables" , "./src/styles/variables/_template.scss" ] , [ "@axios" , "./src/plugins/axios" ] , [ "apexcharts" , "node_modules/apexcharts-clevision" ] ] } ,
234
+ node : true ,
235
+ typescript : { project : './jsconfig.json' } ,
228
236
} ,
229
237
} ,
230
238
}
0 commit comments