Skip to content

Commit cd7d68e

Browse files
committed
chore: 添加 Stylelint
1 parent 698d12e commit cd7d68e

File tree

5 files changed

+88
-69
lines changed

5 files changed

+88
-69
lines changed

.editorconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
root = true
33

44
[*]
5+
charset = utf-8
56
indent_style = space
67
indent_size = 2
7-
charset = utf-8
8-
trim_trailing_whitespace = true
8+
end_of_line = lf
99
insert_final_newline = true
10+
trim_trailing_whitespace = true
1011

1112
[*.md]
1213
trim_trailing_whitespace = false

.stylelintrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "stylelint-config-standard",
3+
"plugins": ["stylelint-scss"],
4+
"rules": {
5+
"at-rule-no-unknown": null,
6+
"scss/at-rule-no-unknown": true
7+
}
8+
}

package.json

Lines changed: 73 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,76 @@
11
{
2-
"name": "taro-ui-examples",
3-
"version": "1.0.0",
4-
"private": true,
5-
"description": "UI KIT for Taro",
6-
"main": "index.js",
7-
"scripts": {
8-
"dev:weapp": "npm run build:weapp -- --watch",
9-
"dev:h5": "npm run build:h5 -- --watch",
10-
"build:weapp": "taro build --type weapp",
2+
"name": "taro-ui-examples",
3+
"version": "1.0.0",
4+
"private": true,
5+
"description": "UI KIT for Taro",
6+
"main": "index.js",
7+
"scripts": {
8+
"dev:weapp": "npm run build:weapp -- --watch",
9+
"dev:h5": "npm run build:h5 -- --watch",
10+
"build:weapp": "taro build --type weapp",
1111
"build:h5": "taro build --type h5",
12-
"lint": "eslint ./src --fix"
13-
},
14-
"husky": {
15-
"hooks": {
16-
"pre-commit": "lint-staged",
17-
"commit-msg": "commitlint -e $GIT_PARAMS"
18-
}
19-
},
20-
"lint-staged": {
21-
"*.js": [
22-
"eslint --quiet --cache --fix",
23-
"git add"
24-
]
25-
},
26-
"author": "O2Team <aotu.io>",
27-
"license": "MIT",
28-
"dependencies": {
29-
"@tarojs/components": "0.0.70",
30-
"@tarojs/router": "0.0.70",
31-
"@tarojs/taro": "0.0.70",
32-
"@tarojs/taro-h5": "0.0.70",
33-
"@tarojs/taro-weapp": "0.0.70",
34-
"lodash": "^4.17.10",
35-
"nervjs": "^1.3.0",
36-
"prop-types": "^15.6.2"
37-
},
38-
"devDependencies": {
39-
"@commitlint/cli": "^7.0.0",
40-
"@commitlint/config-conventional": "^7.0.1",
41-
"@tarojs/cli": "0.0.70",
42-
"@tarojs/plugin-babel": "0.0.70",
43-
"@tarojs/plugin-csso": "0.0.70",
44-
"@tarojs/plugin-sass": "0.0.70",
45-
"@tarojs/plugin-uglifyjs": "0.0.70",
46-
"@tarojs/webpack-runner": "0.0.70",
47-
"babel-eslint": "^8.2.3",
48-
"babel-plugin-transform-class-properties": "^6.24.1",
49-
"babel-plugin-transform-decorators-legacy": "^1.3.4",
50-
"babel-plugin-transform-object-rest-spread": "^6.26.0",
51-
"babel-preset-env": "^1.6.1",
52-
"eslint": "^4.19.1",
53-
"eslint-config-o2team": "^0.1.6",
54-
"eslint-config-taro": "0.0.70",
55-
"eslint-plugin-import": "^2.12.0",
56-
"eslint-plugin-react": "^7.8.2",
57-
"eslint-plugin-taro": "0.0.70",
58-
"glob": "^7.1.2",
59-
"gulp": "^3.9.1",
60-
"gulp-clean": "^0.4.0",
61-
"gulp-concat": "^2.6.1",
62-
"gulp-sass": "^4.0.1",
63-
"husky": "^1.0.0-rc.13",
64-
"lint-staged": "^7.2.0",
65-
"node-fs-extra": "^0.8.2"
66-
}
12+
"lint": "eslint ./src --fix",
13+
"stylelint": "stylelint \"src/**/*.scss\" --syntax scss",
14+
"stylelint-fix": "stylelint \"src/**/*.scss\" --syntax scss --fix"
15+
},
16+
"husky": {
17+
"hooks": {
18+
"pre-commit": "lint-staged",
19+
"commit-msg": "commitlint -e $GIT_PARAMS"
20+
}
21+
},
22+
"lint-staged": {
23+
"*.js": [
24+
"eslint --quiet --cache --fix",
25+
"git add"
26+
],
27+
"src/**/*.scss": [
28+
"stylelint --syntax scss --fix",
29+
"git add"
30+
]
31+
},
32+
"author": "O2Team <aotu.io>",
33+
"license": "MIT",
34+
"dependencies": {
35+
"@tarojs/components": "0.0.70",
36+
"@tarojs/router": "0.0.70",
37+
"@tarojs/taro": "0.0.70",
38+
"@tarojs/taro-h5": "0.0.70",
39+
"@tarojs/taro-weapp": "0.0.70",
40+
"lodash": "^4.17.10",
41+
"nervjs": "^1.3.0",
42+
"prop-types": "^15.6.2"
43+
},
44+
"devDependencies": {
45+
"@commitlint/cli": "^7.0.0",
46+
"@commitlint/config-conventional": "^7.0.1",
47+
"@tarojs/cli": "0.0.70",
48+
"@tarojs/plugin-babel": "0.0.70",
49+
"@tarojs/plugin-csso": "0.0.70",
50+
"@tarojs/plugin-sass": "0.0.70",
51+
"@tarojs/plugin-uglifyjs": "0.0.70",
52+
"@tarojs/webpack-runner": "0.0.70",
53+
"babel-eslint": "^8.2.3",
54+
"babel-plugin-transform-class-properties": "^6.24.1",
55+
"babel-plugin-transform-decorators-legacy": "^1.3.4",
56+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
57+
"babel-preset-env": "^1.6.1",
58+
"eslint": "^4.19.1",
59+
"eslint-config-o2team": "^0.1.6",
60+
"eslint-config-taro": "0.0.70",
61+
"eslint-plugin-import": "^2.12.0",
62+
"eslint-plugin-react": "^7.8.2",
63+
"eslint-plugin-taro": "0.0.70",
64+
"glob": "^7.1.2",
65+
"gulp": "^3.9.1",
66+
"gulp-clean": "^0.4.0",
67+
"gulp-concat": "^2.6.1",
68+
"gulp-sass": "^4.0.1",
69+
"husky": "^1.0.0-rc.13",
70+
"lint-staged": "^7.2.0",
71+
"node-fs-extra": "^0.8.2",
72+
"stylelint": "^9.3.0",
73+
"stylelint-config-standard": "^18.2.0",
74+
"stylelint-scss": "^3.2.0"
75+
}
6776
}

src/app.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@
66
.example {
77
padding: 10px 20px;
88
margin-bottom: 10px;
9+
910
&:not(:first-child) {
1011
border-top: 40px solid #f5f5f5;
1112
}
13+
1214
&__header {
1315
margin-bottom: 20px;
1416
padding-bottom: 10px;
1517
border-bottom: 1px solid rgba($color: #e5e5e5, $alpha: 1);
18+
1619
&-title {
1720
color: #999;
1821
font-size: 28px;
1922
}
2023
}
21-
&__body {
22-
}
2324
}

src/style/mixins/libs/overlay.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
width: 100%;
88
height: 100%;
99
position: absolute;
10-
background-color: rgba($color: #000000, $alpha: 0.3);
10+
background-color: rgba($color: #000, $alpha: 0.3);
1111
}

0 commit comments

Comments
 (0)