setup pug and eslint for webpack

437 Views Asked by At

I try to manage all needable packages over webpack and its going well with sass (after learning from the Internet how to do). But I cant figure it out why it doesnt work for pug and eslint. eslint has the error that no .eslintrc file is found and yes, its not in root folder. But I found two in the eslint dictionary. Does I have to copy the .eslintrc.json / .js into the root? And pug doesnt send me any error, webpack just contiune his work.

package.json

...

"scripts": {
"build": "pug-lint && webpack-dev-server"
},

...

webpack.config.js

var htmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
  // define entry point
  entry: './js/script1.js',
  // define output point
  output: {
    path: 'dist',
    filename: 'bundle.js'
  },

  module: {
    loaders: [
    {
      test: /\.scss$/,
      loader: 'style-loader!css-loader!sass-loader'
    },
    {
      test: /\.pug$/,
      loader: 'pug',
      exclude: /layout/
    }
    ]
  },
  eslint: {
    failOnWarning: false,
    failOnError: true
  },
  devServer: {
    contentBase: './dist/',
    inline: true,
    stats: 'errors-only'
  },
  plugins: [
    new htmlWebpackPlugin({
      template: './src/index.html',
      hash: true
    })
  ]
};
0

There are 0 best solutions below