Authored by 沈志敏

merge

const shelljs = require('shelljs');
const path = require('path');
const ext = process.platform === 'win32' ? '.cmd' : ''; // Windows 平台需要加后缀
const lintPath = {
js: path.resolve('./node_modules/.bin/eslint'),
css: path.resolve('./node_modules/.bin/stylelint')
};
const jsfiles = ['.', 'public/vue/**/*.vue'];
const cssfiles = ['public/scss/**/*.css', 'public/vue/**/*.vue'];
jsfiles.forEach(function(filepath) {
shelljs.exec(`${lintPath.js}${ext} -f table -c .eslintrc --cache ${filepath}`);
});
cssfiles.forEach(function(filepath) {
shelljs.exec(`${lintPath.css}${ext} --syntax scss --config .stylelintrc --custom-formatter ./node_modules/stylelint-formatter-table/index.js '${filepath}'`); // eslint-disable-line
});
... ...
... ... @@ -17,7 +17,8 @@
"lint-css": "stylelint --syntax scss --config .stylelintrc 'public/scss/**/*.css'",
"lint-vue-js": "eslint -c .eslintrc --cache public/vue",
"lint-vue-css": "stylelint --syntax scss --extract --config .stylelintrc 'public/scss/**/*.vue'",
"precommit": "node lint.js"
"lint-all": "node lint-all.js",
"precommit": "node lint-commit.js"
},
"license": "MIT",
"dependencies": {
... ... @@ -86,6 +87,7 @@
"style-loader": "^0.16.0",
"stylelint": "^7.9.0",
"stylelint-config-yoho": "^1.2.8",
"stylelint-formatter-table": "^1.0.2",
"stylelint-processor-html": "^1.0.0",
"stylelint-webpack-plugin": "^0.7.0",
"vue": "^2.1.10",
... ...