Skip to content

Commit 4424f2a

Browse files
committed
Added stylelint
1 parent 864a223 commit 4424f2a

File tree

5 files changed

+214
-14
lines changed

5 files changed

+214
-14
lines changed

.stylelintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"rules": {
3+
"block-no-empty": null,
4+
"color-no-invalid-hex": true
5+
}
6+
}

conf/webpack.conf.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
const webpack = require('webpack');
22
const path = require('path');
3+
const autoprefixer = require('autoprefixer');
34

45
const HtmlWebpackPlugin = require('html-webpack-plugin');
56
const ExtractTextPlugin = require('extract-text-webpack-plugin');
6-
const autoprefixer = require('autoprefixer');
7+
const StyleLintPlugin = require('stylelint-webpack-plugin');
78

89
const dirSrc = path.join(__dirname, '../src');
910
const dirNodeModules = path.join(__dirname, '../node_modules');
@@ -17,7 +18,8 @@ module.exports = {
1718
new HtmlWebpackPlugin({
1819
template: path.join(dirSrc, 'index.html')
1920
}),
20-
new ExtractTextPlugin('style.[hash].css')
21+
new ExtractTextPlugin('style.[hash].css'),
22+
new StyleLintPlugin()
2123
],
2224
entry: {
2325
app: path.join(dirSrc, 'index'),

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"dependencies": {
88
"@uirouter/angularjs": "^1.0.10",
99
"angular": "^1.6.6",
10-
"normalize-scss": "^7.0.0",
11-
"box-sizing-border-box": "^1.0.1"
10+
"box-sizing-border-box": "^1.0.1",
11+
"normalize-scss": "^7.0.0"
1212
},
1313
"devDependencies": {
1414
"autoprefixer": "^7.1.6",
@@ -34,14 +34,19 @@
3434
"postcss-loader": "^2.0.8",
3535
"sass-loader": "^6.0.6",
3636
"style-loader": "^0.19.0",
37+
"stylelint": "^8.2.0",
38+
"stylelint-webpack-plugin": "^0.9.0",
3739
"webpack": "^3.8.1",
3840
"webpack-dev-server": "^2.9.3"
3941
},
4042
"scripts": {
4143
"dev": "NODE_ENV=dev webpack-dev-server --progress --config conf/webpack.conf.dev.js",
4244
"build": "NODE_ENV=prod webpack -p --progress --config conf/webpack.conf.build.js"
4345
},
44-
"browserslist": ["last 2 versions", "ie >= 10"],
46+
"browserslist": [
47+
"last 2 versions",
48+
"ie >= 10"
49+
],
4550
"eslintConfig": {
4651
"root": true,
4752
"env": {

src/app/hello/_hello.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ hello {
99
flex-wrap: wrap;
1010
justify-content: center;
1111

12+
font: {
13+
family: sans-serif;
14+
size: 18px;
15+
}
16+
1217
a {
1318
align-items: center;
1419
background-position: center center;

0 commit comments

Comments
 (0)