Skip to content

Commit

Permalink
add stylelint
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsOnlyBinary committed Feb 4, 2018
1 parent 70f39fd commit 82a3df8
Show file tree
Hide file tree
Showing 5 changed files with 730 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/build/
/config/
/dist/
/node_modules/
/test/unit/coverage/
6 changes: 6 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: 'stylelint-config-standard',
rules: {
indentation: 4,
}
};
8 changes: 8 additions & 0 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
const StyleLintPlugin = require('stylelint-webpack-plugin');

function resolve (dir) {
return path.join(__dirname, '..', dir)
Expand Down Expand Up @@ -31,6 +32,13 @@ module.exports = {
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
plugins: [
// Stylelint for all imports
// https://github.com/vieron/stylelint-webpack-plugin
new StyleLintPlugin({
files: ['src/**/*.{vue,htm,html,css,sss,less,scss}'],
})
],
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"translate": "node build/locales.js",
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
"test": "npm run unit",
"lint": "eslint --ext .js,.vue src test/unit/specs"
"lint:eslint": "eslint --ext .js,.vue src test/unit/specs",
"lint:stylelint": "stylelint \"src/**/*.{vue,htm,html,css,sss,less,scss}\"",
"lint": "npm run lint:eslint && npm run lint:stylelint",
"lint:fix": "npm run lint:eslint -- --fix && npm run lint:stylelint -- --fix"
},
"engines": {
"node": ">=6",
Expand All @@ -33,6 +36,7 @@
"eslint": "^4.15.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-friendly-formatter": "^2.0.5",
"eslint-import-resolver-webpack": "^0.8.3",
"eslint-loader": "^1.5.0",
"eslint-plugin-html": "^4.0.1",
"eslint-plugin-import": "^2.8.0",
Expand Down Expand Up @@ -60,6 +64,9 @@
"postcss-loader": "^2.0.10",
"postcss-url": "^7.3.0",
"shelljs": "^0.7.4",
"stylelint": "^8.4.0",
"stylelint-config-standard": "^18.0.0",
"stylelint-webpack-plugin": "^0.10.1",
"sockjs-client": "^1.1.1",
"strftime": "^0.9.2",
"uppy": "^0.18.0",
Expand Down
Loading

0 comments on commit 82a3df8

Please sign in to comment.