Skip to content

Commit c8cf710

Browse files
committed
feat: updates according to pro
1 parent 131c484 commit c8cf710

Some content is hidden

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

75 files changed

+4544
-2182
lines changed

typescript-version/.eslintrc.js typescript-version/.eslintrc.cjs

+22-12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = {
1111
'plugin:promise/recommended',
1212
'plugin:sonarjs/recommended',
1313
'plugin:@typescript-eslint/recommended',
14+
'plugin:case-police/recommended',
1415

1516
// 'plugin:unicorn/recommended',
1617
],
@@ -25,21 +26,24 @@ module.exports = {
2526
'@typescript-eslint',
2627
'regex',
2728
],
28-
ignorePatterns: ['src/@iconify/*.js', 'node_modules', 'dist', '*.d.ts'],
29+
ignorePatterns: ['src/plugins/iconify/*.js', 'node_modules', 'dist', '*.d.ts', 'vendor'],
2930
rules: {
3031
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
3132
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
3233

3334
// indentation (Already present in TypeScript)
3435
'comma-spacing': ['error', { before: false, after: true }],
3536
'key-spacing': ['error', { afterColon: true }],
37+
'n/prefer-global/process': ['off'],
38+
'sonarjs/cognitive-complexity': ['off'],
3639

3740
'vue/first-attribute-linebreak': ['error', {
3841
singleline: 'beside',
3942
multiline: 'below',
4043
}],
4144

4245
'antfu/top-level-function': 'off',
46+
'@typescript-eslint/no-explicit-any': 'off',
4347

4448
// indentation (Already present in TypeScript)
4549
'indent': ['error', 2],
@@ -50,6 +54,9 @@ module.exports = {
5054
// Enforce consistent spacing inside braces of object (Already present in TypeScript)
5155
'object-curly-spacing': ['error', 'always'],
5256

57+
// Enforce camelCase naming convention
58+
'camelcase': 'error',
59+
5360
// Disable max-len
5461
'max-len': 'off',
5562

@@ -72,11 +79,14 @@ module.exports = {
7279
allowClassStart: true,
7380
allowObjectStart: true,
7481
allowArrayStart: true,
82+
83+
// We don't want to add extra space above closing SECTION
84+
ignorePattern: '!SECTION',
7585
},
7686
],
7787

7888
// Ignore _ as unused variable
79-
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_+$' }],
89+
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_+$', argsIgnorePattern: '^_+$' }],
8090

8191
'array-element-newline': ['error', 'consistent'],
8292
'array-bracket-newline': ['error', 'consistent'],
@@ -94,7 +104,10 @@ module.exports = {
94104
// Plugin: eslint-plugin-import
95105
'import/prefer-default-export': 'off',
96106
'import/newline-after-import': ['error', { count: 1 }],
97-
'no-restricted-imports': ['error', 'vuetify/components'],
107+
'no-restricted-imports': ['error', 'vuetify/components', {
108+
name: 'vue3-apexcharts',
109+
message: 'apexcharts are autoimported',
110+
}],
98111

99112
// For omitting extension for ts files
100113
'import/extensions': [
@@ -132,7 +145,7 @@ module.exports = {
132145
// ESLint plugin vue
133146
'vue/block-tag-newline': 'error',
134147
'vue/component-api-style': 'error',
135-
'vue/component-name-in-template-casing': ['error', 'PascalCase', { registeredComponentsOnly: false }],
148+
'vue/component-name-in-template-casing': ['error', 'PascalCase', { registeredComponentsOnly: false, ignores: ['/^swiper-/'] }],
136149
'vue/custom-event-name-casing': ['error', 'camelCase', {
137150
ignores: [
138151
'/^(click):[a-z]+((\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?/',
@@ -146,8 +159,7 @@ module.exports = {
146159
'vue/no-child-content': 'error',
147160
'vue/require-default-prop': 'off',
148161

149-
// 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
150-
// 'vue/no-duplicate-attr-inheritance': 'error',
162+
'vue/no-duplicate-attr-inheritance': 'error',
151163
'vue/no-empty-component-block': 'error',
152164
'vue/no-multiple-objects-in-class': 'error',
153165
'vue/no-reserved-component-names': 'error',
@@ -191,9 +203,9 @@ module.exports = {
191203
message: 'Use \'@images\' path alias for image imports',
192204
},
193205
{
194-
regex: '@/styles',
206+
regex: '@/assets/styles',
195207
replacement: '@styles',
196-
message: 'Use \'@styles\' path alias for importing styles from \'src/styles\'',
208+
message: 'Use \'@styles\' path alias for importing styles from \'src/assets/styles\'',
197209
},
198210

199211
// {
@@ -219,14 +231,12 @@ module.exports = {
219231
],
220232

221233
// Ignore files
222-
'\.eslintrc\.js',
234+
'\.eslintrc\.cjs',
223235
],
224236
},
225237
settings: {
226238
'import/resolver': {
227-
node: {
228-
extensions: ['.ts', '.js', '.tsx', '.jsx', '.mjs', '.png', '.jpg'],
229-
},
239+
node: true,
230240
typescript: {},
231241
},
232242
},

typescript-version/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ dist-ssr
1616
/cypress/videos/
1717
/cypress/screenshots/
1818

19+
# 👉 Custom Git ignores
20+
1921
# Editor directories and files
2022
.vscode/*
2123
!.vscode/extensions.json
@@ -32,3 +34,10 @@ dist-ssr
3234

3335
# iconify dist files
3436
src/plugins/iconify/icons.css
37+
38+
# Ignore MSW script
39+
public/mockServiceWorker.js
40+
41+
# Env files
42+
.env*
43+
!.env.example

typescript-version/.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
auto-install-peers=true
2+
shamefully-hoist=true

typescript-version/.stylelintrc.json

+41-30
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,45 @@
11
{
2-
"extends": [
3-
"stylelint-config-standard-scss",
4-
"stylelint-config-idiomatic-order"
5-
],
6-
"plugins": [
7-
"stylelint-use-logical-spec"
2+
"extends": [
3+
"stylelint-config-standard-scss",
4+
"stylelint-config-idiomatic-order"
5+
],
6+
"plugins": [
7+
"stylelint-use-logical-spec",
8+
"stylelint-codeguide"
9+
],
10+
"overrides": [
11+
{
12+
"files": [
13+
"**/*.scss"
14+
],
15+
"customSyntax": "postcss-scss"
16+
},
17+
{
18+
"files": [
19+
"**/*.vue"
20+
],
21+
"customSyntax": "postcss-html"
22+
}
23+
],
24+
"rules": {
25+
"codeguide/max-line-length": [
26+
120,
27+
{
28+
"ignore": "comments"
29+
}
830
],
9-
"overrides": [
10-
{
11-
"files": [
12-
"**/*.scss"
13-
],
14-
"customSyntax": "postcss-scss"
15-
},
16-
{
17-
"files": [
18-
"**/*.vue"
19-
],
20-
"customSyntax": "postcss-html"
21-
}
31+
"codeguide/indentation": 2,
32+
"liberty/use-logical-spec": true,
33+
"selector-class-pattern": null,
34+
"color-function-notation": null,
35+
"annotation-no-unknown": [
36+
true,
37+
{
38+
"ignoreAnnotations": [
39+
"default"
40+
]
41+
}
2242
],
23-
"rules": {
24-
"max-line-length": [
25-
120,
26-
{
27-
"ignore": "comments"
28-
}
29-
],
30-
"liberty/use-logical-spec": true,
31-
"selector-class-pattern": null,
32-
"color-function-notation": null
33-
}
43+
"media-feature-range-notation": null
44+
}
3445
}

typescript-version/.vscode/extensions.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
"editorconfig.editorconfig",
55
"xabikos.javascriptsnippets",
66
"stylelint.vscode-stylelint",
7+
"fabiospampinato.vscode-highlight",
78
"github.vscode-pull-request-github",
89
"vue.volar",
910
"antfu.iconify",
1011
"cipchk.cssrem",
11-
"matijao.vue-nuxt-snippets"
12+
"matijao.vue-nuxt-snippets",
13+
"dongido.sync-env"
1214
]
1315
}

typescript-version/.vscode/settings.json

+9-10
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
},
3939
"eslint.alwaysShowStatus": true,
4040
"eslint.format.enable": true,
41-
"eslint.packageManager": "yarn",
41+
"eslint.packageManager": "pnpm",
4242
// Extension: Stylelint
43-
"stylelint.packageManager": "yarn",
43+
"stylelint.packageManager": "pnpm",
4444
"stylelint.validate": [
4545
"css",
4646
"scss",
@@ -50,41 +50,40 @@
5050
"cSpell.words": [
5151
"Composables",
5252
"Customizer",
53+
"destr",
5354
"flagpack",
5455
"Iconify",
56+
"ofetch",
5557
"psudo",
5658
"stylelint",
5759
"touchless",
5860
"triggerer",
5961
"vuetify"
6062
],
6163
// Extension: Comment Anchors
62-
"commentAnchors.tags.list": [
63-
{
64-
"tag": "ℹ️",
64+
"commentAnchors.tags.anchors": {
65+
"ℹ️": {
6566
"scope": "hidden",
6667
// This color is taken from "Better Comments" Extension (?)
6768
"highlightColor": "#3498DB",
6869
"styleComment": true,
6970
"isItalic": false,
7071
},
71-
{
72-
"tag": "👉",
72+
"👉": {
7373
"scope": "file",
7474
// This color is taken from "Better Comments" Extension (*)
7575
"highlightColor": "#98C379",
7676
"styleComment": true,
7777
"isItalic": false
7878
},
79-
{
80-
"tag": "",
79+
"❗": {
8180
"scope": "hidden",
8281
// This color is taken from "Better Comments" Extension (*)
8382
"highlightColor": "#FF2D00",
8483
"styleComment": true,
8584
"isItalic": false,
8685
},
87-
],
86+
},
8887
// Extension: fabiospampinato.vscode-highlight
8988
"highlight.regexFlags": "gi",
9089
"highlight.regexes": {

typescript-version/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ This template should help get you started developing with Vue 3 in Vite.
44

55
## Recommended IDE Setup
66

7-
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur).
7+
[VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur).
88

99
## Type Support for `.vue` Imports in TS
1010

1111
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates.
1212

13-
However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can run `Volar: Switch TS Plugin on/off` from VSCode command palette.
13+
However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can run `Volar: Switch TS Plugin on/off` from VS Code command palette.
1414

1515
## Customize configuration
1616

0 commit comments

Comments
 (0)