Authored by ccbikai(👎🏻🍜)

eslint

... ... @@ -14,9 +14,9 @@
"build": "webpack --config ./public/build/webpack.prod.config.js",
"debug": "DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js",
"lint-js": "eslint -c .eslintrc --cache .",
"lint-css": "stylelint --syntax scss --config .stylelintrc public/scss/*.css public/scss/**/*.css",
"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/vue/*.vue public/vue/**/*.vue",
"lint-vue-css": "stylelint --syntax scss --extract --config .stylelintrc 'public/scss/**/*.vue'",
"precommit": "node lint.js"
},
"license": "MIT",
... ... @@ -63,6 +63,7 @@
"cssnano": "^3.10.0",
"eslint": "^3.16.0",
"eslint-config-yoho": "^1.0.1",
"eslint-loader": "^1.6.3",
"eslint-plugin-html": "^2.0.1",
"extract-text-webpack-plugin": "^2.1.0",
"handlebars-loader": "^1.4.0",
... ...
... ... @@ -13,7 +13,6 @@ const shelljs = require('shelljs');
const webpack = require('webpack');
const HappyPack = require('happypack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const postcssConfig = require('./postcss.config.js');
const entries = {
index: path.join(__dirname, '../scss/index.css'),
... ... @@ -98,7 +97,8 @@ module.exports = (env) => {
}]
},
resolve: {
modules: [path.join(__dirname, '../../node_modules'),
modules: [
path.join(__dirname, '../../node_modules'),
path.join(__dirname, '../vue'),
path.join(__dirname, '../hbs'),
path.join(__dirname, '../scss'),
... ... @@ -112,9 +112,6 @@ module.exports = (env) => {
children: false
},
plugins: [
new StyleLintPlugin({
files: ['public/scss/*.css', 'public/scss/**/*.css', 'public/vue/*.vue', 'public/vue/**/*.vue']
}),
new HappyPack({
id: 'js',
threadPool: happyThreadPool,
... ...
const path = require('path');
const webpack = require('webpack');
const StyleLintPlugin = require('stylelint-webpack-plugin');
let baseConfig = require('./webpack.base.config.js');
baseConfig = baseConfig('dev');
baseConfig.devtool = '#eval';
baseConfig.output.publicPath = 'http://localhost:5001/';
baseConfig.module.rules.push({
enforce: 'pre',
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
cache: true,
failOnError: true,
formatter: require('eslint/lib/formatters/table')
}
});
baseConfig.devServer = {
host: '0.0.0.0',
port: 5001,
... ... @@ -12,8 +24,6 @@ baseConfig.devServer = {
publicPath: baseConfig.output.publicPath,
hot: true,
inline: true,
// quiet: true,
// clientLogLevel: 'error',
compress: true,
stats: {
colors: true,
... ... @@ -25,6 +35,10 @@ baseConfig.devServer = {
}
baseConfig.plugins.push(
new StyleLintPlugin({
files: ['public/scss/**/*.css'],
failOnError: true
}),
new webpack.HotModuleReplacementPlugin()
);
... ...