Skip to content

Commit 7784af5

Browse files
committed
fix(stylelint): css v-bind error
1 parent ff1ae8b commit 7784af5

File tree

8 files changed

+67
-81
lines changed

8 files changed

+67
-81
lines changed

.vscode/settings.json

Lines changed: 13 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,64 +7,27 @@
77
// Disable the default formatter, use eslint instead
88
"prettier.enable": false,
99
"editor.formatOnSave": false,
10+
1011
// Auto fix
1112
"editor.codeActionsOnSave": {
1213
"source.fixAll.eslint": "explicit",
1314
"source.organizeImports": "never"
1415
},
16+
1517
// Silent the stylistic rules in your IDE, but still auto fix them
1618
"eslint.rules.customizations": [
17-
{
18-
"rule": "style/*",
19-
"severity": "off",
20-
"fixable": true
21-
},
22-
{
23-
"rule": "format/*",
24-
"severity": "off",
25-
"fixable": true
26-
},
27-
{
28-
"rule": "*-indent",
29-
"severity": "off",
30-
"fixable": true
31-
},
32-
{
33-
"rule": "*-spacing",
34-
"severity": "off",
35-
"fixable": true
36-
},
37-
{
38-
"rule": "*-spaces",
39-
"severity": "off",
40-
"fixable": true
41-
},
42-
{
43-
"rule": "*-order",
44-
"severity": "off",
45-
"fixable": true
46-
},
47-
{
48-
"rule": "*-dangle",
49-
"severity": "off",
50-
"fixable": true
51-
},
52-
{
53-
"rule": "*-newline",
54-
"severity": "off",
55-
"fixable": true
56-
},
57-
{
58-
"rule": "*quotes",
59-
"severity": "off",
60-
"fixable": true
61-
},
62-
{
63-
"rule": "*semi",
64-
"severity": "off",
65-
"fixable": true
66-
}
19+
{ "rule": "style/*", "severity": "off", "fixable": true },
20+
{ "rule": "format/*", "severity": "off", "fixable": true },
21+
{ "rule": "*-indent", "severity": "off", "fixable": true },
22+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
23+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
24+
{ "rule": "*-order", "severity": "off", "fixable": true },
25+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
26+
{ "rule": "*-newline", "severity": "off", "fixable": true },
27+
{ "rule": "*quotes", "severity": "off", "fixable": true },
28+
{ "rule": "*semi", "severity": "off", "fixable": true }
6729
],
30+
6831
// Enable eslint for all supported languages
6932
"eslint.validate": [
7033
"javascript",

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
},
1010
"scripts": {
1111
"build": "pnpm -r --stream --filter=@tomjs/* build",
12-
"lint": "eslint --fix",
12+
"lint": "run-s lint:*",
13+
"lint:stylelint": "stylelint \"packages/**/*.{scss,less,scss}\" --fix",
1314
"lint:eslint": "eslint --fix",
1415
"prepare": "simple-git-hooks"
1516
},
@@ -19,6 +20,7 @@
1920
"@tomjs/commitlint": "workspace:^",
2021
"@tomjs/eslint": "workspace:^",
2122
"@tomjs/prettier": "workspace:^",
23+
"@tomjs/stylelint": "workspace:*",
2224
"@tomjs/tsconfig": "workspace:^",
2325
"@types/node": "^20.19.25",
2426
"eslint": "^9.39.2",
@@ -27,6 +29,7 @@
2729
"publint": "^0.3.16",
2830
"rimraf": "^6.1.2",
2931
"simple-git-hooks": "^2.13.1",
32+
"stylelint": "^17.0.0",
3033
"tsdown": "^0.19.0",
3134
"typescript": "^5.9.3"
3235
}

packages/stylelint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"postcss": "^8.5.6",
5454
"postcss-html": "^1.8.1",
5555
"postcss-scss": "^4.0.9",
56-
"stylelint-config-recess-order": "^7.4.0",
56+
"stylelint-config-recess-order": "^7.6.0",
5757
"stylelint-config-recommended": "^18.0.0",
5858
"stylelint-config-recommended-scss": "^17.0.0",
5959
"stylelint-config-recommended-vue": "^1.6.1",

packages/stylelint/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ const config: Config = {
2424
ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted'],
2525
},
2626
],
27+
'declaration-property-value-no-unknown': [
28+
true,
29+
{
30+
ignoreProperties: {
31+
'/.*/': ['/^v-bind\\(/'],
32+
},
33+
},
34+
],
2735
},
2836
},
2937
{

packages/stylelint/test/base.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@use './var';
2+
3+
body {
4+
padding: 0;
5+
margin: 0;
6+
}
7+
8+
.red-text {
9+
color: $color;
10+
border: 1px solid $bg-color;
11+
}
12+
13+
.yellow-text {
14+
color: var(--color);
15+
}

packages/stylelint/test/var.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$color: red;
2+
$bg-color: blue;
3+
4+
:root {
5+
--color: yellow;
6+
}

pnpm-lock.yaml

Lines changed: 17 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

stylelint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
extends: ['@tomjs/stylelint'],
3+
};

0 commit comments

Comments
 (0)