Commit c2b207dd5172519a87cb23e34114e5d104ce56a1

Authored by vben
1 parent 83921284

fix: Fix stylelint does not support html files

.gitpod.yml
@@ -3,4 +3,4 @@ ports: @@ -3,4 +3,4 @@ ports:
3 onOpen: open-preview 3 onOpen: open-preview
4 tasks: 4 tasks:
5 - init: pnpm install 5 - init: pnpm install
6 - command: pnpm dev 6 + command: pnpm run dev
.husky/lintstagedrc.js deleted 100644 → 0
1 -module.exports = {  
2 - '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],  
3 - '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'],  
4 - 'package.json': ['prettier --write'],  
5 - '*.vue': ['eslint --fix', 'prettier --write', 'stylelint --fix'],  
6 - '*.{scss,less,styl,html}': ['stylelint --fix', 'prettier --write'],  
7 - '*.md': ['prettier --write'],  
8 -};  
index.html
@@ -8,7 +8,6 @@ @@ -8,7 +8,6 @@
8 name="viewport" 8 name="viewport"
9 content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" 9 content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
10 /> 10 />
11 -  
12 <title><%= title %></title> 11 <title><%= title %></title>
13 <link rel="icon" href="/favicon.ico" /> 12 <link rel="icon" href="/favicon.ico" />
14 </head> 13 </head>
@@ -30,7 +29,7 @@ @@ -30,7 +29,7 @@
30 } 29 }
31 30
32 html[data-theme='dark'] .app-loading .app-loading-title { 31 html[data-theme='dark'] .app-loading .app-loading-title {
33 - color: rgba(255, 255, 255, 0.85); 32 + color: rgb(255 255 255 / 85%);
34 } 33 }
35 34
36 .app-loading { 35 .app-loading {
@@ -48,7 +47,7 @@ @@ -48,7 +47,7 @@
48 top: 50%; 47 top: 50%;
49 left: 50%; 48 left: 50%;
50 display: flex; 49 display: flex;
51 - -webkit-transform: translate3d(-50%, -50%, 0); 50 + transform: translate3d(-50%, -50%, 0);
52 transform: translate3d(-50%, -50%, 0); 51 transform: translate3d(-50%, -50%, 0);
53 justify-content: center; 52 justify-content: center;
54 align-items: center; 53 align-items: center;
@@ -66,7 +65,7 @@ @@ -66,7 +65,7 @@
66 display: flex; 65 display: flex;
67 margin-top: 30px; 66 margin-top: 30px;
68 font-size: 30px; 67 font-size: 30px;
69 - color: rgba(0, 0, 0, 0.85); 68 + color: rgb(0 0 0 / 85%);
70 justify-content: center; 69 justify-content: center;
71 align-items: center; 70 align-items: center;
72 } 71 }
@@ -97,7 +96,7 @@ @@ -97,7 +96,7 @@
97 height: 20px; 96 height: 20px;
98 background-color: #0065cc; 97 background-color: #0065cc;
99 border-radius: 100%; 98 border-radius: 100%;
100 - opacity: 0.3; 99 + opacity: 30%;
101 transform: scale(0.75); 100 transform: scale(0.75);
102 animation: antSpinMove 1s infinite linear alternate; 101 animation: antSpinMove 1s infinite linear alternate;
103 transform-origin: 50% 50%; 102 transform-origin: 50% 50%;
@@ -111,43 +110,43 @@ @@ -111,43 +110,43 @@
111 .dot i:nth-child(2) { 110 .dot i:nth-child(2) {
112 top: 0; 111 top: 0;
113 right: 0; 112 right: 0;
114 - -webkit-animation-delay: 0.4s; 113 + animation-delay: 0.4s;
115 animation-delay: 0.4s; 114 animation-delay: 0.4s;
116 } 115 }
117 116
118 .dot i:nth-child(3) { 117 .dot i:nth-child(3) {
119 right: 0; 118 right: 0;
120 bottom: 0; 119 bottom: 0;
121 - -webkit-animation-delay: 0.8s; 120 + animation-delay: 0.8s;
122 animation-delay: 0.8s; 121 animation-delay: 0.8s;
123 } 122 }
124 123
125 .dot i:nth-child(4) { 124 .dot i:nth-child(4) {
126 bottom: 0; 125 bottom: 0;
127 left: 0; 126 left: 0;
128 - -webkit-animation-delay: 1.2s; 127 + animation-delay: 1.2s;
129 animation-delay: 1.2s; 128 animation-delay: 1.2s;
130 } 129 }
131 @keyframes antRotate { 130 @keyframes antRotate {
132 to { 131 to {
133 - -webkit-transform: rotate(405deg); 132 + transform: rotate(405deg);
134 transform: rotate(405deg); 133 transform: rotate(405deg);
135 } 134 }
136 } 135 }
137 - @-webkit-keyframes antRotate { 136 + @keyframes antRotate {
138 to { 137 to {
139 - -webkit-transform: rotate(405deg); 138 + transform: rotate(405deg);
140 transform: rotate(405deg); 139 transform: rotate(405deg);
141 } 140 }
142 } 141 }
143 @keyframes antSpinMove { 142 @keyframes antSpinMove {
144 to { 143 to {
145 - opacity: 1; 144 + opacity: 100%;
146 } 145 }
147 } 146 }
148 - @-webkit-keyframes antSpinMove { 147 + @keyframes antSpinMove {
149 to { 148 to {
150 - opacity: 1; 149 + opacity: 100%;
151 } 150 }
152 } 151 }
153 </style> 152 </style>
package.json
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 "lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix", 23 "lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
24 "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"", 24 "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
25 "lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/", 25 "lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
26 - "lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js", 26 + "lint:lint-staged": "lint-staged",
27 "test:unit": "jest", 27 "test:unit": "jest",
28 "test:unit-coverage": "jest --coverage", 28 "test:unit-coverage": "jest --coverage",
29 "test:gzip": "npx http-server dist --cors --gzip -c-1", 29 "test:gzip": "npx http-server dist --cors --gzip -c-1",
@@ -159,5 +159,29 @@ @@ -159,5 +159,29 @@
159 "homepage": "https://github.com/anncwb/vue-vben-admin", 159 "homepage": "https://github.com/anncwb/vue-vben-admin",
160 "engines": { 160 "engines": {
161 "node": "^12 || >=14" 161 "node": "^12 || >=14"
  162 + },
  163 + "lint-staged": {
  164 + "*.{js,jsx,ts,tsx}": [
  165 + "eslint --fix",
  166 + "prettier --write"
  167 + ],
  168 + "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
  169 + "prettier --write--parser json"
  170 + ],
  171 + "package.json": [
  172 + "prettier --write"
  173 + ],
  174 + "*.vue": [
  175 + "eslint --fix",
  176 + "prettier --write",
  177 + "stylelint --fix"
  178 + ],
  179 + "*.{scss,less,styl,html}": [
  180 + "stylelint --fix",
  181 + "prettier --write"
  182 + ],
  183 + "*.md": [
  184 + "prettier --write"
  185 + ]
162 } 186 }
163 } 187 }
stylelint.config.js
@@ -71,9 +71,10 @@ module.exports = { @@ -71,9 +71,10 @@ module.exports = {
71 ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'], 71 ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
72 overrides: [ 72 overrides: [
73 { 73 {
74 - files: ['*.vue', '**/*.vue'], 74 + files: ['*.vue', '**/*.vue', '*.html', '**/*.html'],
75 extends: ['stylelint-config-recommended', 'stylelint-config-html'], 75 extends: ['stylelint-config-recommended', 'stylelint-config-html'],
76 rules: { 76 rules: {
  77 + 'keyframes-name-pattern': null,
77 'selector-pseudo-class-no-unknown': [ 78 'selector-pseudo-class-no-unknown': [
78 true, 79 true,
79 { 80 {