Skip to content

Commit

Permalink
chore: 添加 Stylelint
Browse files Browse the repository at this point in the history
  • Loading branch information
koppthe committed Jul 22, 2018
1 parent 698d12e commit cd7d68e
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 69 deletions.
5 changes: 3 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
8 changes: 8 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "stylelint-config-standard",
"plugins": ["stylelint-scss"],
"rules": {
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": true
}
}
137 changes: 73 additions & 64 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,76 @@
{
"name": "taro-ui-examples",
"version": "1.0.0",
"private": true,
"description": "UI KIT for Taro",
"main": "index.js",
"scripts": {
"dev:weapp": "npm run build:weapp -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"build:weapp": "taro build --type weapp",
"name": "taro-ui-examples",
"version": "1.0.0",
"private": true,
"description": "UI KIT for Taro",
"main": "index.js",
"scripts": {
"dev:weapp": "npm run build:weapp -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"build:weapp": "taro build --type weapp",
"build:h5": "taro build --type h5",
"lint": "eslint ./src --fix"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -e $GIT_PARAMS"
}
},
"lint-staged": {
"*.js": [
"eslint --quiet --cache --fix",
"git add"
]
},
"author": "O2Team <aotu.io>",
"license": "MIT",
"dependencies": {
"@tarojs/components": "0.0.70",
"@tarojs/router": "0.0.70",
"@tarojs/taro": "0.0.70",
"@tarojs/taro-h5": "0.0.70",
"@tarojs/taro-weapp": "0.0.70",
"lodash": "^4.17.10",
"nervjs": "^1.3.0",
"prop-types": "^15.6.2"
},
"devDependencies": {
"@commitlint/cli": "^7.0.0",
"@commitlint/config-conventional": "^7.0.1",
"@tarojs/cli": "0.0.70",
"@tarojs/plugin-babel": "0.0.70",
"@tarojs/plugin-csso": "0.0.70",
"@tarojs/plugin-sass": "0.0.70",
"@tarojs/plugin-uglifyjs": "0.0.70",
"@tarojs/webpack-runner": "0.0.70",
"babel-eslint": "^8.2.3",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"eslint": "^4.19.1",
"eslint-config-o2team": "^0.1.6",
"eslint-config-taro": "0.0.70",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-taro": "0.0.70",
"glob": "^7.1.2",
"gulp": "^3.9.1",
"gulp-clean": "^0.4.0",
"gulp-concat": "^2.6.1",
"gulp-sass": "^4.0.1",
"husky": "^1.0.0-rc.13",
"lint-staged": "^7.2.0",
"node-fs-extra": "^0.8.2"
}
"lint": "eslint ./src --fix",
"stylelint": "stylelint \"src/**/*.scss\" --syntax scss",
"stylelint-fix": "stylelint \"src/**/*.scss\" --syntax scss --fix"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -e $GIT_PARAMS"
}
},
"lint-staged": {
"*.js": [
"eslint --quiet --cache --fix",
"git add"
],
"src/**/*.scss": [
"stylelint --syntax scss --fix",
"git add"
]
},
"author": "O2Team <aotu.io>",
"license": "MIT",
"dependencies": {
"@tarojs/components": "0.0.70",
"@tarojs/router": "0.0.70",
"@tarojs/taro": "0.0.70",
"@tarojs/taro-h5": "0.0.70",
"@tarojs/taro-weapp": "0.0.70",
"lodash": "^4.17.10",
"nervjs": "^1.3.0",
"prop-types": "^15.6.2"
},
"devDependencies": {
"@commitlint/cli": "^7.0.0",
"@commitlint/config-conventional": "^7.0.1",
"@tarojs/cli": "0.0.70",
"@tarojs/plugin-babel": "0.0.70",
"@tarojs/plugin-csso": "0.0.70",
"@tarojs/plugin-sass": "0.0.70",
"@tarojs/plugin-uglifyjs": "0.0.70",
"@tarojs/webpack-runner": "0.0.70",
"babel-eslint": "^8.2.3",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"eslint": "^4.19.1",
"eslint-config-o2team": "^0.1.6",
"eslint-config-taro": "0.0.70",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-taro": "0.0.70",
"glob": "^7.1.2",
"gulp": "^3.9.1",
"gulp-clean": "^0.4.0",
"gulp-concat": "^2.6.1",
"gulp-sass": "^4.0.1",
"husky": "^1.0.0-rc.13",
"lint-staged": "^7.2.0",
"node-fs-extra": "^0.8.2",
"stylelint": "^9.3.0",
"stylelint-config-standard": "^18.2.0",
"stylelint-scss": "^3.2.0"
}
}
5 changes: 3 additions & 2 deletions src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@
.example {
padding: 10px 20px;
margin-bottom: 10px;

&:not(:first-child) {
border-top: 40px solid #f5f5f5;
}

&__header {
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 1px solid rgba($color: #e5e5e5, $alpha: 1);

&-title {
color: #999;
font-size: 28px;
}
}
&__body {
}
}
2 changes: 1 addition & 1 deletion src/style/mixins/libs/overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
width: 100%;
height: 100%;
position: absolute;
background-color: rgba($color: #000000, $alpha: 0.3);
background-color: rgba($color: #000, $alpha: 0.3);
}

0 comments on commit cd7d68e

Please sign in to comment.