Skip to content

Commit 345a1bb

Browse files
committed
refactor(javascript-version): updated js-version
1 parent e0fb2b2 commit 345a1bb

File tree

152 files changed

+10777
-8391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+10777
-8391
lines changed

javascript-version/.eslintrc-auto-import.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
"ComponentPublicInstance": true,
55
"ComputedRef": true,
66
"EffectScope": true,
7+
"ExtractDefaultPropTypes": true,
8+
"ExtractPropTypes": true,
9+
"ExtractPublicPropTypes": true,
710
"InjectionKey": true,
811
"PropType": true,
912
"Ref": true,
1013
"VNode": true,
14+
"WritableComputedRef": true,
1115
"acceptHMRUpdate": true,
1216
"asyncComputed": true,
1317
"autoResetRef": true,
@@ -45,6 +49,7 @@
4549
"h": true,
4650
"ignorableWatch": true,
4751
"inject": true,
52+
"injectLocal": true,
4853
"isDefined": true,
4954
"isProxy": true,
5055
"isReactive": true,
@@ -82,6 +87,7 @@
8287
"onUpdated": true,
8388
"pausableWatch": true,
8489
"provide": true,
90+
"provideLocal": true,
8591
"reactify": true,
8692
"reactifyObject": true,
8793
"reactive": true,
@@ -152,6 +158,7 @@
152158
"useCeil": true,
153159
"useClamp": true,
154160
"useClipboard": true,
161+
"useClipboardItems": true,
155162
"useCloned": true,
156163
"useColorMode": true,
157164
"useConfirmDialog": true,
@@ -258,7 +265,6 @@
258265
"useSpeechRecognition": true,
259266
"useSpeechSynthesis": true,
260267
"useStepper": true,
261-
"useStorage": true,
262268
"useStorageAsync": true,
263269
"useStyleTag": true,
264270
"useSum": true,

javascript-version/.eslintrc.js renamed to javascript-version/.eslintrc.cjs

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ module.exports = {
99
'plugin:import/recommended',
1010
'plugin:promise/recommended',
1111
'plugin:sonarjs/recommended',
12+
'plugin:case-police/recommended',
13+
'plugin:regexp/recommended',
1214

1315
// 'plugin:unicorn/recommended',
1416
],
@@ -20,15 +22,18 @@ module.exports = {
2022
plugins: [
2123
'vue',
2224
'regex',
25+
'regexp',
2326
],
24-
ignorePatterns: ['src/@iconify/*.js', 'node_modules', 'dist'],
27+
ignorePatterns: ['src/plugins/iconify/*.js', 'node_modules', 'dist', '*.d.ts', 'vendor', '*.json'],
2528
rules: {
2629
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
2730
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
2831

2932
// indentation (Already present in TypeScript)
3033
'comma-spacing': ['error', { before: false, after: true }],
3134
'key-spacing': ['error', { afterColon: true }],
35+
'n/prefer-global/process': ['off'],
36+
'sonarjs/cognitive-complexity': ['off'],
3237

3338
'vue/first-attribute-linebreak': ['error', {
3439
singleline: 'beside',
@@ -45,6 +50,9 @@ module.exports = {
4550
// Enforce consistent spacing inside braces of object (Already present in TypeScript)
4651
'object-curly-spacing': ['error', 'always'],
4752

53+
// Enforce camelCase naming convention
54+
'camelcase': 'error',
55+
4856
// Disable max-len
4957
'max-len': 'off',
5058

@@ -67,6 +75,9 @@ module.exports = {
6775
allowClassStart: true,
6876
allowObjectStart: true,
6977
allowArrayStart: true,
78+
79+
// We don't want to add extra space above closing SECTION
80+
ignorePattern: '!SECTION',
7081
},
7182
],
7283

@@ -88,7 +99,10 @@ module.exports = {
8899
// Plugin: eslint-plugin-import
89100
'import/prefer-default-export': 'off',
90101
'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+
}],
92106

93107
// For omitting extension for ts files
94108
'import/extensions': [
@@ -107,6 +121,8 @@ module.exports = {
107121
ignore: [
108122
'~pages$',
109123
'virtual:generated-layouts',
124+
'#auth$',
125+
'#components$',
110126

111127
// Ignore vite's ?raw imports
112128
'.*\?raw',
@@ -124,7 +140,7 @@ module.exports = {
124140
// ESLint plugin vue
125141
'vue/block-tag-newline': 'error',
126142
'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-/'] }],
128144
'vue/custom-event-name-casing': ['error', 'camelCase', {
129145
ignores: [
130146
'/^(click):[a-z]+((\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?/',
@@ -138,8 +154,7 @@ module.exports = {
138154
'vue/no-child-content': 'error',
139155
'vue/require-default-prop': 'off',
140156

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',
143158
'vue/no-empty-component-block': 'error',
144159
'vue/no-multiple-objects-in-class': 'error',
145160
'vue/no-reserved-component-names': 'error',
@@ -171,6 +186,8 @@ module.exports = {
171186
// },
172187
// }],
173188

189+
// Internal Rules
190+
174191
// https://github.com/gmullerb/eslint-plugin-regex
175192
'regex/invalid': [
176193
'error',
@@ -181,16 +198,16 @@ module.exports = {
181198
message: 'Use \'@images\' path alias for image imports',
182199
},
183200
{
184-
regex: '@/styles',
201+
regex: '@/assets/styles',
185202
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\'',
187204
},
188205

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+
},
194211

195212
{
196213
regex: '@core/\\w',
@@ -206,25 +223,16 @@ module.exports = {
206223
inspect: '^(?!.*(@core|@layouts)).*',
207224
},
208225
},
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-
},
217226
],
218227

219228
// Ignore files
220-
'\.eslintrc\.js',
229+
'\.eslintrc\.cjs',
221230
],
222231
},
223232
settings: {
224233
'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' },
228236
},
229237
},
230238
}

0 commit comments

Comments
 (0)