Commit ba2415c3b42b0a02f3c1fe954a941280171ea80a

Authored by vben
1 parent 84a5fc12

chore: Extract lint config

Too many changes to show.

To preserve performance only 21 of 130 files are displayed.

.eslintrc.js
1 module.exports = { 1 module.exports = {
2 root: true, 2 root: true,
3 - env: {  
4 - browser: true,  
5 - node: true,  
6 - es6: true,  
7 - },  
8 - parser: 'vue-eslint-parser',  
9 - parserOptions: {  
10 - parser: '@typescript-eslint/parser',  
11 - ecmaVersion: 2020,  
12 - sourceType: 'module',  
13 - jsxPragma: 'React',  
14 - ecmaFeatures: {  
15 - jsx: true,  
16 - },  
17 - },  
18 - extends: [  
19 - 'plugin:vue/vue3-recommended',  
20 - 'plugin:@typescript-eslint/recommended',  
21 - 'plugin:prettier/recommended',  
22 - ],  
23 - rules: {  
24 - 'vue/script-setup-uses-vars': 'error',  
25 - '@typescript-eslint/ban-ts-ignore': 'off',  
26 - '@typescript-eslint/explicit-function-return-type': 'off',  
27 - '@typescript-eslint/no-explicit-any': 'off',  
28 - '@typescript-eslint/no-var-requires': 'off',  
29 - '@typescript-eslint/no-empty-function': 'off',  
30 - 'vue/custom-event-name-casing': 'off',  
31 - 'no-use-before-define': 'off',  
32 - '@typescript-eslint/no-use-before-define': 'off',  
33 - '@typescript-eslint/ban-ts-comment': 'off',  
34 - '@typescript-eslint/ban-types': 'off',  
35 - '@typescript-eslint/no-non-null-assertion': 'off',  
36 - '@typescript-eslint/explicit-module-boundary-types': 'off',  
37 - '@typescript-eslint/no-unused-vars': [  
38 - 'error',  
39 - {  
40 - argsIgnorePattern: '^_',  
41 - varsIgnorePattern: '^_',  
42 - },  
43 - ],  
44 - 'no-unused-vars': [  
45 - 'error',  
46 - {  
47 - argsIgnorePattern: '^_',  
48 - varsIgnorePattern: '^_',  
49 - },  
50 - ],  
51 - 'space-before-function-paren': 'off',  
52 -  
53 - 'vue/attributes-order': 'off',  
54 - 'vue/one-component-per-file': 'off',  
55 - 'vue/html-closing-bracket-newline': 'off',  
56 - 'vue/max-attributes-per-line': 'off',  
57 - 'vue/multiline-html-element-content-newline': 'off',  
58 - 'vue/singleline-html-element-content-newline': 'off',  
59 - 'vue/attribute-hyphenation': 'off',  
60 - 'vue/require-default-prop': 'off',  
61 - 'vue/require-explicit-emits': 'off',  
62 - 'vue/html-self-closing': [  
63 - 'error',  
64 - {  
65 - html: {  
66 - void: 'always',  
67 - normal: 'never',  
68 - component: 'always',  
69 - },  
70 - svg: 'always',  
71 - math: 'always',  
72 - },  
73 - ],  
74 - 'vue/multi-word-component-names': 'off',  
75 - }, 3 + extends: ['@vben'],
76 }; 4 };
.github/workflows/deploy.yml
@@ -98,7 +98,7 @@ jobs: @@ -98,7 +98,7 @@ jobs:
98 98
99 - name: Build 99 - name: Build
100 env: 100 env:
101 - NODE_OPTIONS: "--max_old_space_size=4096" 101 + NODE_OPTIONS: '--max_old_space_size=4096'
102 run: | 102 run: |
103 yarn install 103 yarn install
104 yarn run build 104 yarn run build
@@ -116,8 +116,3 @@ jobs: @@ -116,8 +116,3 @@ jobs:
116 PUBLISH_BRANCH: gh-pages 116 PUBLISH_BRANCH: gh-pages
117 PUBLISH_DIR: ./dist 117 PUBLISH_DIR: ./dist
118 CNAME: vben.vvbin.cn 118 CNAME: vben.vvbin.cn
119 -  
120 -  
121 -  
122 -  
123 -  
.gitignore
1 node_modules 1 node_modules
2 .DS_Store 2 .DS_Store
3 dist 3 dist
4 -.npmrc  
5 .cache 4 .cache
  5 +.turbo
6 6
7 tests/server/static 7 tests/server/static
8 tests/server/static/upload 8 tests/server/static/upload
.husky/pre-commit
@@ -7,4 +7,4 @@ @@ -7,4 +7,4 @@
7 PATH="/usr/local/bin:$PATH" 7 PATH="/usr/local/bin:$PATH"
8 8
9 # Format and submit code according to lintstagedrc.js configuration 9 # Format and submit code according to lintstagedrc.js configuration
10 -npm run lint:lint-staged 10 +pnpm exec lint-staged
.npmrc 0 โ†’ 100644
  1 +public-hoist-pattern[]=husky
  2 +public-hoist-pattern[]=*eslint*
  3 +public-hoist-pattern[]=*prettier*
  4 +public-hoist-pattern[]=lint-staged
  5 +public-hoist-pattern[]=*stylelint*
  6 +public-hoist-pattern[]=@commitlint/cli
  7 +public-hoist-pattern[]=@vben/eslint-config
.prettierignore
1 -/dist/* 1 +dist
2 .local 2 .local
3 .output.js 3 .output.js
4 -/node_modules/** 4 +node_modules
5 5
6 **/*.svg 6 **/*.svg
7 **/*.sh 7 **/*.sh
8 8
9 -/public/* 9 +public
  10 +.npmrc
.prettierrc.js
@@ -7,4 +7,5 @@ module.exports = { @@ -7,4 +7,5 @@ module.exports = {
7 proseWrap: 'never', 7 proseWrap: 'never',
8 htmlWhitespaceSensitivity: 'strict', 8 htmlWhitespaceSensitivity: 'strict',
9 endOfLine: 'auto', 9 endOfLine: 'auto',
  10 + plugins: ['prettier-plugin-packagejson'],
10 }; 11 };
.stylelintignore
1 -/dist/*  
2 -/public/*  
3 -public/* 1 +dist
  2 +public
.stylelintrc.js
1 module.exports = { 1 module.exports = {
2 root: true, 2 root: true,
3 - plugins: ['stylelint-order'],  
4 - extends: ['stylelint-config-standard'],  
5 - customSyntax: 'postcss-html',  
6 - rules: {  
7 - 'function-no-unknown': null,  
8 - 'selector-class-pattern': null,  
9 - 'selector-pseudo-class-no-unknown': [  
10 - true,  
11 - {  
12 - ignorePseudoClasses: ['global', 'deep'],  
13 - },  
14 - ],  
15 - 'selector-pseudo-element-no-unknown': [  
16 - true,  
17 - {  
18 - ignorePseudoElements: ['v-deep'],  
19 - },  
20 - ],  
21 - 'at-rule-no-unknown': [  
22 - true,  
23 - {  
24 - ignoreAtRules: [  
25 - 'tailwind',  
26 - 'apply',  
27 - 'variants',  
28 - 'responsive',  
29 - 'screen',  
30 - 'function',  
31 - 'if',  
32 - 'each',  
33 - 'include',  
34 - 'mixin',  
35 - ],  
36 - },  
37 - ],  
38 - 'no-empty-source': null,  
39 - 'string-quotes': null,  
40 - 'named-grid-areas-no-invalid': null,  
41 - 'unicode-bom': 'never',  
42 - 'no-descending-specificity': null,  
43 - 'font-family-no-missing-generic-family-keyword': null,  
44 - 'declaration-colon-space-after': 'always-single-line',  
45 - 'declaration-colon-space-before': 'never',  
46 - // 'declaration-block-trailing-semicolon': 'always',  
47 - 'rule-empty-line-before': [  
48 - 'always',  
49 - {  
50 - ignore: ['after-comment', 'first-nested'],  
51 - },  
52 - ],  
53 - 'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],  
54 - 'order/order': [  
55 - [  
56 - 'dollar-variables',  
57 - 'custom-properties',  
58 - 'at-rules',  
59 - 'declarations',  
60 - {  
61 - type: 'at-rule',  
62 - name: 'supports',  
63 - },  
64 - {  
65 - type: 'at-rule',  
66 - name: 'media',  
67 - },  
68 - 'rules',  
69 - ],  
70 - { severity: 'warning' },  
71 - ],  
72 - },  
73 - ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],  
74 - overrides: [  
75 - {  
76 - files: ['*.vue', '**/*.vue', '*.html', '**/*.html'],  
77 - extends: ['stylelint-config-recommended'],  
78 - rules: {  
79 - 'keyframes-name-pattern': null,  
80 - 'selector-pseudo-class-no-unknown': [  
81 - true,  
82 - {  
83 - ignorePseudoClasses: ['deep', 'global'],  
84 - },  
85 - ],  
86 - 'selector-pseudo-element-no-unknown': [  
87 - true,  
88 - {  
89 - ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted'],  
90 - },  
91 - ],  
92 - },  
93 - },  
94 - {  
95 - files: ['*.less', '**/*.less'],  
96 - customSyntax: 'postcss-less',  
97 - extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue'],  
98 - },  
99 - ], 3 + extends: ['@vben/stylelint-config'],
100 }; 4 };
.vscode/settings.json
@@ -84,7 +84,8 @@ @@ -84,7 +84,8 @@
84 "editor.defaultFormatter": "esbenp.prettier-vscode" 84 "editor.defaultFormatter": "esbenp.prettier-vscode"
85 }, 85 },
86 "editor.codeActionsOnSave": { 86 "editor.codeActionsOnSave": {
87 - "source.fixAll.eslint": true 87 + "source.fixAll.eslint": true,
  88 + "source.fixAll.stylelint": true
88 }, 89 },
89 "[vue]": { 90 "[vue]": {
90 "editor.codeActionsOnSave": { 91 "editor.codeActionsOnSave": {
@@ -165,7 +166,7 @@ @@ -165,7 +166,7 @@
165 "*.tsx": "$(capture).test.ts, $(capture).test.tsx", 166 "*.tsx": "$(capture).test.ts, $(capture).test.tsx",
166 "*.env": "$(capture).env.*", 167 "*.env": "$(capture).env.*",
167 "CHANGELOG.md": "CHANGELOG*", 168 "CHANGELOG.md": "CHANGELOG*",
168 - "package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,README*", 169 + "package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,README*,.npmrc",
169 ".eslintrc.js": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.js,.prettierrc.js,.stylelintrc.js" 170 ".eslintrc.js": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.js,.prettierrc.js,.stylelintrc.js"
170 }, 171 },
171 "terminal.integrated.scrollback": 10000 172 "terminal.integrated.scrollback": 10000
_internal/.gitkeep deleted 100644 โ†’ 0
build/vite/plugin/mock.ts
@@ -6,7 +6,7 @@ import { viteMockServe } from 'vite-plugin-mock'; @@ -6,7 +6,7 @@ import { viteMockServe } from 'vite-plugin-mock';
6 6
7 export function configMockPlugin(isBuild: boolean) { 7 export function configMockPlugin(isBuild: boolean) {
8 return viteMockServe({ 8 return viteMockServe({
9 - ignore: /^\_/, 9 + ignore: /^_/,
10 mockPath: 'mock', 10 mockPath: 'mock',
11 localEnabled: !isBuild, 11 localEnabled: !isBuild,
12 prodEnabled: isBuild, 12 prodEnabled: isBuild,
index.html
@@ -34,39 +34,39 @@ @@ -34,39 +34,39 @@
34 34
35 .app-loading { 35 .app-loading {
36 display: flex; 36 display: flex;
  37 + flex-direction: column;
  38 + align-items: center;
  39 + justify-content: center;
37 width: 100%; 40 width: 100%;
38 height: 100%; 41 height: 100%;
39 - justify-content: center;  
40 - align-items: center;  
41 - flex-direction: column;  
42 background-color: #f4f7f9; 42 background-color: #f4f7f9;
43 } 43 }
44 44
45 .app-loading .app-loading-wrap { 45 .app-loading .app-loading-wrap {
  46 + display: flex;
46 position: absolute; 47 position: absolute;
47 top: 50%; 48 top: 50%;
48 left: 50%; 49 left: 50%;
49 - display: flex;  
50 - transform: translate3d(-50%, -50%, 0);  
51 - justify-content: center;  
52 - align-items: center;  
53 flex-direction: column; 50 flex-direction: column;
  51 + align-items: center;
  52 + justify-content: center;
  53 + transform: translate3d(-50%, -50%, 0);
54 } 54 }
55 55
56 .app-loading .dots { 56 .app-loading .dots {
57 display: flex; 57 display: flex;
58 - padding: 98px;  
59 - justify-content: center;  
60 align-items: center; 58 align-items: center;
  59 + justify-content: center;
  60 + padding: 98px;
61 } 61 }
62 62
63 .app-loading .app-loading-title { 63 .app-loading .app-loading-title {
64 display: flex; 64 display: flex;
  65 + align-items: center;
  66 + justify-content: center;
65 margin-top: 30px; 67 margin-top: 30px;
66 - font-size: 30px;  
67 color: rgb(0 0 0 / 85%); 68 color: rgb(0 0 0 / 85%);
68 - justify-content: center;  
69 - align-items: center; 69 + font-size: 30px;
70 } 70 }
71 71
72 .app-loading .app-loading-logo { 72 .app-loading .app-loading-logo {
@@ -77,28 +77,28 @@ @@ -77,28 +77,28 @@
77 } 77 }
78 78
79 .dot { 79 .dot {
80 - position: relative;  
81 display: inline-block; 80 display: inline-block;
  81 + position: relative;
  82 + box-sizing: border-box;
82 width: 48px; 83 width: 48px;
83 height: 48px; 84 height: 48px;
84 margin-top: 30px; 85 margin-top: 30px;
85 - font-size: 32px;  
86 transform: rotate(45deg); 86 transform: rotate(45deg);
87 - box-sizing: border-box;  
88 - animation: antRotate 1.2s infinite linear; 87 + animation: ant-rotate 1.2s infinite linear;
  88 + font-size: 32px;
89 } 89 }
90 90
91 .dot i { 91 .dot i {
92 - position: absolute;  
93 display: block; 92 display: block;
  93 + position: absolute;
94 width: 20px; 94 width: 20px;
95 height: 20px; 95 height: 20px;
96 - background-color: #0065cc;  
97 - border-radius: 100%;  
98 - opacity: 30%;  
99 transform: scale(0.75); 96 transform: scale(0.75);
100 - animation: antSpinMove 1s infinite linear alternate;  
101 transform-origin: 50% 50%; 97 transform-origin: 50% 50%;
  98 + animation: ant-spin-move 1s infinite linear alternate;
  99 + border-radius: 100%;
  100 + opacity: 0.3;
  101 + background-color: #0065cc;
102 } 102 }
103 103
104 .dot i:nth-child(1) { 104 .dot i:nth-child(1) {
@@ -123,24 +123,28 @@ @@ -123,24 +123,28 @@
123 left: 0; 123 left: 0;
124 animation-delay: 1.2s; 124 animation-delay: 1.2s;
125 } 125 }
126 - @keyframes antRotate { 126 +
  127 + @keyframes ant-rotate {
127 to { 128 to {
128 transform: rotate(405deg); 129 transform: rotate(405deg);
129 } 130 }
130 } 131 }
131 - @keyframes antRotate { 132 +
  133 + @keyframes ant-rotate {
132 to { 134 to {
133 transform: rotate(405deg); 135 transform: rotate(405deg);
134 } 136 }
135 } 137 }
136 - @keyframes antSpinMove { 138 +
  139 + @keyframes ant-spin-move {
137 to { 140 to {
138 - opacity: 100%; 141 + opacity: 1;
139 } 142 }
140 } 143 }
141 - @keyframes antSpinMove { 144 +
  145 + @keyframes ant-spin-move {
142 to { 146 to {
143 - opacity: 100%; 147 + opacity: 1;
144 } 148 }
145 } 149 }
146 </style> 150 </style>
internal/eslint-config/build.config.ts 0 โ†’ 100644
  1 +import { defineBuildConfig } from 'unbuild';
  2 +
  3 +export default defineBuildConfig({
  4 + clean: true,
  5 + entries: ['src/index'],
  6 + declaration: true,
  7 + rollup: {
  8 + emitCJS: true,
  9 + },
  10 +});
internal/eslint-config/package.json 0 โ†’ 100644
  1 +{
  2 + "name": "@vben/eslint-config",
  3 + "version": "1.0.0",
  4 + "private": true,
  5 + "license": "MIT",
  6 + "exports": {
  7 + ".": {
  8 + "types": "./dist/index.d.ts",
  9 + "import": "./dist/index.mjs",
  10 + "require": "./dist/index.cjs"
  11 + }
  12 + },
  13 + "main": "./dist/index.cjs",
  14 + "module": "./dist/index.mjs",
  15 + "types": "./dist/index.d.ts",
  16 + "files": [
  17 + "dist"
  18 + ],
  19 + "scripts": {
  20 + "clean": "pnpm rimraf .turbo node_modules dist",
  21 + "stub": "pnpm unbuild --stub"
  22 + },
  23 + "devDependencies": {
  24 + "@typescript-eslint/eslint-plugin": "^5.57.0",
  25 + "@typescript-eslint/parser": "^5.57.0",
  26 + "eslint": "^8.37.0",
  27 + "eslint-config-prettier": "^8.8.0",
  28 + "eslint-plugin-prettier": "^4.2.1",
  29 + "eslint-plugin-vue": "^9.10.0",
  30 + "vue-eslint-parser": "^9.1.1"
  31 + }
  32 +}
internal/eslint-config/src/index.ts 0 โ†’ 100644
  1 +export default {
  2 + env: {
  3 + browser: true,
  4 + node: true,
  5 + es6: true,
  6 + },
  7 + parser: 'vue-eslint-parser',
  8 + parserOptions: {
  9 + parser: '@typescript-eslint/parser',
  10 + ecmaVersion: 2020,
  11 + sourceType: 'module',
  12 + jsxPragma: 'React',
  13 + ecmaFeatures: {
  14 + jsx: true,
  15 + },
  16 + project: './tsconfig.*?.json',
  17 + createDefaultProgram: false,
  18 + extraFileExtensions: ['.vue'],
  19 + },
  20 + plugins: ['vue', '@typescript-eslint'],
  21 + extends: [
  22 + 'eslint:recommended',
  23 + 'plugin:vue/vue3-recommended',
  24 + 'plugin:@typescript-eslint/recommended',
  25 + 'plugin:prettier/recommended',
  26 + ],
  27 + rules: {
  28 + 'no-case-declarations': 'off',
  29 + 'vue/script-setup-uses-vars': 'error',
  30 + 'vue/no-reserved-component-names': 'off',
  31 + '@typescript-eslint/ban-ts-ignore': 'off',
  32 + '@typescript-eslint/explicit-function-return-type': 'off',
  33 + '@typescript-eslint/no-explicit-any': 'off',
  34 + '@typescript-eslint/no-var-requires': 'off',
  35 + '@typescript-eslint/no-empty-function': 'off',
  36 + 'vue/custom-event-name-casing': 'off',
  37 + 'no-use-before-define': 'off',
  38 + '@typescript-eslint/no-use-before-define': 'off',
  39 + '@typescript-eslint/ban-ts-comment': 'off',
  40 + '@typescript-eslint/ban-types': 'off',
  41 + '@typescript-eslint/no-non-null-assertion': 'off',
  42 + '@typescript-eslint/explicit-module-boundary-types': 'off',
  43 + '@typescript-eslint/no-unused-vars': [
  44 + 'error',
  45 + {
  46 + argsIgnorePattern: '^_',
  47 + varsIgnorePattern: '^_',
  48 + },
  49 + ],
  50 + 'no-unused-vars': [
  51 + 'error',
  52 + {
  53 + argsIgnorePattern: '^_',
  54 + varsIgnorePattern: '^_',
  55 + },
  56 + ],
  57 + 'space-before-function-paren': 'off',
  58 +
  59 + 'vue/attributes-order': 'off',
  60 + 'vue/one-component-per-file': 'off',
  61 + 'vue/html-closing-bracket-newline': 'off',
  62 + 'vue/max-attributes-per-line': 'off',
  63 + 'vue/multiline-html-element-content-newline': 'off',
  64 + 'vue/singleline-html-element-content-newline': 'off',
  65 + 'vue/attribute-hyphenation': 'off',
  66 + 'vue/require-default-prop': 'off',
  67 + 'vue/require-explicit-emits': 'off',
  68 + 'vue/html-self-closing': [
  69 + 'error',
  70 + {
  71 + html: {
  72 + void: 'always',
  73 + normal: 'never',
  74 + component: 'always',
  75 + },
  76 + svg: 'always',
  77 + math: 'always',
  78 + },
  79 + ],
  80 + 'vue/multi-word-component-names': 'off',
  81 + },
  82 +};
internal/stylelint-config/build.config.ts 0 โ†’ 100644
  1 +import { defineBuildConfig } from 'unbuild';
  2 +
  3 +export default defineBuildConfig({
  4 + clean: true,
  5 + entries: ['src/index'],
  6 + declaration: true,
  7 + rollup: {
  8 + emitCJS: true,
  9 + },
  10 +});
internal/stylelint-config/package.json 0 โ†’ 100644
  1 +{
  2 + "name": "@vben/stylelint-config",
  3 + "version": "1.0.0",
  4 + "private": true,
  5 + "license": "MIT",
  6 + "exports": {
  7 + ".": {
  8 + "types": "./dist/index.d.ts",
  9 + "import": "./dist/index.mjs",
  10 + "require": "./dist/index.cjs"
  11 + }
  12 + },
  13 + "main": "./dist/index.cjs",
  14 + "module": "./dist/index.mjs",
  15 + "types": "./dist/index.d.ts",
  16 + "files": [
  17 + "dist"
  18 + ],
  19 + "scripts": {
  20 + "clean": "pnpm rimraf .turbo node_modules dist",
  21 + "stub": "pnpm unbuild --stub"
  22 + },
  23 + "devDependencies": {
  24 + "postcss": "^8.4.21",
  25 + "postcss-html": "^1.5.0",
  26 + "postcss-less": "^6.0.0",
  27 + "postcss-scss": "^4.0.6",
  28 + "prettier": "^2.8.7",
  29 + "stylelint": "^15.4.0",
  30 + "stylelint-config-property-sort-order-smacss": "^9.1.0",
  31 + "stylelint-config-recommended": "^11.0.0",
  32 + "stylelint-config-recommended-scss": "^9.0.1",
  33 + "stylelint-config-recommended-vue": "^1.4.0",
  34 + "stylelint-config-standard": "^32.0.0",
  35 + "stylelint-config-standard-scss": "^7.0.1",
  36 + "stylelint-order": "^6.0.3",
  37 + "stylelint-prettier": "^3.0.0"
  38 + }
  39 +}
internal/stylelint-config/src/index.ts 0 โ†’ 100644
  1 +export default {
  2 + extends: ['stylelint-config-standard', 'stylelint-config-property-sort-order-smacss'],
  3 + plugins: ['stylelint-order', 'stylelint-prettier'],
  4 + // customSyntax: 'postcss-html',
  5 + overrides: [
  6 + {
  7 + files: ['**/*.(css|html|vue)'],
  8 + customSyntax: 'postcss-html',
  9 + },
  10 + {
  11 + files: ['*.less', '**/*.less'],
  12 + customSyntax: 'postcss-less',
  13 + extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue'],
  14 + },
  15 + {
  16 + files: ['*.scss', '**/*.scss'],
  17 + customSyntax: 'postcss-scss',
  18 + extends: ['stylelint-config-standard-scss', 'stylelint-config-recommended-vue/scss'],
  19 + rule: {
  20 + 'scss/percent-placeholder-pattern': null,
  21 + },
  22 + },
  23 + ],
  24 + rules: {
  25 + 'function-no-unknown': null,
  26 + 'selector-class-pattern': null,
  27 + 'selector-pseudo-class-no-unknown': [
  28 + true,
  29 + {
  30 + ignorePseudoClasses: ['global', 'deep'],
  31 + },
  32 + ],
  33 + 'selector-pseudo-element-no-unknown': [
  34 + true,
  35 + {
  36 + ignorePseudoElements: ['v-deep'],
  37 + },
  38 + ],
  39 + 'at-rule-no-unknown': [
  40 + true,
  41 + {
  42 + ignoreAtRules: [
  43 + 'tailwind',
  44 + 'apply',
  45 + 'variants',
  46 + 'responsive',
  47 + 'screen',
  48 + 'function',
  49 + 'if',
  50 + 'each',
  51 + 'include',
  52 + 'mixin',
  53 + 'extend',
  54 + ],
  55 + },
  56 + ],
  57 + 'no-empty-source': null,
  58 + 'string-quotes': null,
  59 + 'named-grid-areas-no-invalid': null,
  60 + 'no-descending-specificity': null,
  61 + 'font-family-no-missing-generic-family-keyword': null,
  62 + 'rule-empty-line-before': [
  63 + 'always',
  64 + {
  65 + ignore: ['after-comment', 'first-nested'],
  66 + },
  67 + ],
  68 + 'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
  69 + 'order/order': [
  70 + [
  71 + 'dollar-variables',
  72 + 'custom-properties',
  73 + 'at-rules',
  74 + 'declarations',
  75 + {
  76 + type: 'at-rule',
  77 + name: 'supports',
  78 + },
  79 + {
  80 + type: 'at-rule',
  81 + name: 'media',
  82 + },
  83 + 'rules',
  84 + ],
  85 + { severity: 'error' },
  86 + ],
  87 + },
  88 + ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
  89 +};
internal/ts-config/package.json 0 โ†’ 100644
  1 +{
  2 + "name": "@vben/ts-config",
  3 + "version": "1.0.0",
  4 + "private": true,
  5 + "license": "MIT",
  6 + "devDependencies": {}
  7 +}
package.json
@@ -16,36 +16,36 @@ @@ -16,36 +16,36 @@
16 "url": "https://github.com/anncwb" 16 "url": "https://github.com/anncwb"
17 }, 17 },
18 "scripts": { 18 "scripts": {
19 - "commit": "czg",  
20 "bootstrap": "pnpm install", 19 "bootstrap": "pnpm install",
21 - "serve": "npm run dev",  
22 - "dev": "vite",  
23 "build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts", 20 "build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
24 - "build:test": "cross-env vite build --mode test && esno ./build/script/postBuild.ts",  
25 "build:no-cache": "pnpm clean:cache && npm run build", 21 "build:no-cache": "pnpm clean:cache && npm run build",
26 - "report": "cross-env REPORT=true npm run build",  
27 - "type:check": "vue-tsc --noEmit --skipLibCheck",  
28 - "preview": "npm run build && vite preview",  
29 - "preview:dist": "vite preview",  
30 - "log": "conventional-changelog -p angular -i CHANGELOG.md -s", 22 + "build:test": "cross-env vite build --mode test && esno ./build/script/postBuild.ts",
31 "clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite", 23 "clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite",
32 "clean:lib": "rimraf node_modules", 24 "clean:lib": "rimraf node_modules",
  25 + "commit": "czg",
  26 + "dev": "vite",
  27 + "gen:icon": "esno ./build/generate/icon/index.ts",
  28 + "preinstall": "npx only-allow pnpm",
  29 + "postinstall": "turbo run stub",
33 "lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix", 30 "lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
34 "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"", 31 "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
35 - "lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",  
36 - "lint:lint-staged": "lint-staged",  
37 - "test:unit": "jest",  
38 - "test:gzip": "npx http-server dist --cors --gzip -c-1",  
39 - "test:br": "npx http-server dist --cors --brotli -c-1",  
40 - "reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",  
41 - "preinstall": "npx only-allow pnpm", 32 + "lint:stylelint": "stylelint \"**/*.{vue,css,less.scss}\" --fix --cache --cache-location node_modules/.cache/stylelint/",
  33 + "log": "conventional-changelog -p angular -i CHANGELOG.md -s",
42 "prepare": "husky install", 34 "prepare": "husky install",
43 - "gen:icon": "esno ./build/generate/icon/index.ts" 35 + "preview": "npm run build && vite preview",
  36 + "preview:dist": "vite preview",
  37 + "reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
  38 + "report": "cross-env REPORT=true npm run build",
  39 + "serve": "npm run dev",
  40 + "test:br": "npx http-server dist --cors --brotli -c-1",
  41 + "test:gzip": "npx http-server dist --cors --gzip -c-1",
  42 + "test:unit": "jest",
  43 + "type:check": "vue-tsc --noEmit --skipLibCheck"
44 }, 44 },
45 "lint-staged": { 45 "lint-staged": {
46 "*.{js,jsx,ts,tsx}": [ 46 "*.{js,jsx,ts,tsx}": [
47 - "eslint --fix",  
48 - "prettier --write" 47 + "prettier --write",
  48 + "eslint --fix"
49 ], 49 ],
50 "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [ 50 "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
51 "prettier --write--parser json" 51 "prettier --write--parser json"
@@ -54,13 +54,13 @@ @@ -54,13 +54,13 @@
54 "prettier --write" 54 "prettier --write"
55 ], 55 ],
56 "*.vue": [ 56 "*.vue": [
57 - "eslint --fix",  
58 "prettier --write", 57 "prettier --write",
  58 + "eslint --fix",
59 "stylelint --fix" 59 "stylelint --fix"
60 ], 60 ],
61 "*.{scss,less,styl,html}": [ 61 "*.{scss,less,styl,html}": [
62 - "stylelint --fix",  
63 - "prettier --write" 62 + "prettier --write",
  63 + "stylelint --fix"
64 ], 64 ],
65 "*.md": [ 65 "*.md": [
66 "prettier --write" 66 "prettier --write"
@@ -133,8 +133,8 @@ @@ -133,8 +133,8 @@
133 "@types/qs": "^6.9.7", 133 "@types/qs": "^6.9.7",
134 "@types/showdown": "^2.0.0", 134 "@types/showdown": "^2.0.0",
135 "@types/sortablejs": "^1.15.1", 135 "@types/sortablejs": "^1.15.1",
136 - "@typescript-eslint/eslint-plugin": "^5.57.0",  
137 - "@typescript-eslint/parser": "^5.57.0", 136 + "@vben/eslint-config": "workspace:*",
  137 + "@vben/stylelint-config": "workspace:*",
138 "@vitejs/plugin-vue": "^4.1.0", 138 "@vitejs/plugin-vue": "^4.1.0",
139 "@vitejs/plugin-vue-jsx": "^3.0.1", 139 "@vitejs/plugin-vue-jsx": "^3.0.1",
140 "@vue/compiler-sfc": "^3.2.47", 140 "@vue/compiler-sfc": "^3.2.47",
@@ -145,31 +145,24 @@ @@ -145,31 +145,24 @@
145 "cz-git": "^1.6.1", 145 "cz-git": "^1.6.1",
146 "czg": "^1.6.1", 146 "czg": "^1.6.1",
147 "dotenv": "^16.0.3", 147 "dotenv": "^16.0.3",
148 - "eslint": "^8.37.0",  
149 - "eslint-config-prettier": "^8.8.0",  
150 - "eslint-plugin-prettier": "^4.2.1",  
151 - "eslint-plugin-vue": "^9.10.0",  
152 "esno": "^0.16.3", 148 "esno": "^0.16.3",
153 "fs-extra": "^11.1.1", 149 "fs-extra": "^11.1.1",
154 "husky": "^8.0.3", 150 "husky": "^8.0.3",
155 "inquirer": "^9.1.5", 151 "inquirer": "^9.1.5",
156 "less": "^4.1.3", 152 "less": "^4.1.3",
157 "lint-staged": "13.2.0", 153 "lint-staged": "13.2.0",
158 - "npm-run-all": "^4.1.5",  
159 "picocolors": "^1.0.0", 154 "picocolors": "^1.0.0",
160 "postcss": "^8.4.21", 155 "postcss": "^8.4.21",
161 "postcss-html": "^1.5.0", 156 "postcss-html": "^1.5.0",
162 "postcss-less": "^6.0.0", 157 "postcss-less": "^6.0.0",
163 "prettier": "^2.8.7", 158 "prettier": "^2.8.7",
  159 + "prettier-plugin-packagejson": "^2.4.3",
164 "rimraf": "^4.4.1", 160 "rimraf": "^4.4.1",
165 "rollup-plugin-visualizer": "^5.9.0", 161 "rollup-plugin-visualizer": "^5.9.0",
166 "sass": "^1.60.0", 162 "sass": "^1.60.0",
167 - "stylelint": "^15.4.0",  
168 - "stylelint-config-recommended": "^11.0.0",  
169 - "stylelint-config-recommended-vue": "^1.4.0",  
170 - "stylelint-config-standard": "^32.0.0",  
171 - "stylelint-order": "^6.0.3", 163 + "turbo": "^1.8.8",
172 "typescript": "^5.0.3", 164 "typescript": "^5.0.3",
  165 + "unbuild": "^1.2.0",
173 "vite": "^4.3.0-beta.1", 166 "vite": "^4.3.0-beta.1",
174 "vite-plugin-compression": "^0.5.1", 167 "vite-plugin-compression": "^0.5.1",
175 "vite-plugin-html": "^3.2.0", 168 "vite-plugin-html": "^3.2.0",
@@ -177,7 +170,6 @@ @@ -177,7 +170,6 @@
177 "vite-plugin-purge-icons": "^0.9.2", 170 "vite-plugin-purge-icons": "^0.9.2",
178 "vite-plugin-svg-icons": "^2.0.1", 171 "vite-plugin-svg-icons": "^2.0.1",
179 "vite-plugin-windicss": "^1.8.10", 172 "vite-plugin-windicss": "^1.8.10",
180 - "vue-eslint-parser": "^9.1.1",  
181 "vue-tsc": "^1.2.0" 173 "vue-tsc": "^1.2.0"
182 }, 174 },
183 "packageManager": "pnpm@8.1.0", 175 "packageManager": "pnpm@8.1.0",