You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 18, 2019. It is now read-only.
I believe the documentation is incorrect, as the code example gives an error.
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration has an unknown property 'jshint'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
For typos: please correct them.
For loader options: webpack 2 no longer allows custom properties in configuration.
Loaders should be updated to allow passing options via loader options in module.rules.
Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
plugins: [
new webpack.LoaderOptionsPlugin({
// test: /\.xxx$/, // may apply this only for some modules
options: {
jshint: ...
}
})
]
What kind of issue are you submitting? Bug Report
Please tell us your
Webpack version 3.8.1
jshint-loader version 0.8.4
jshint version Whichever jshint-loader installs
OS OSX
Use this configuration and run webpack:
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './js/init.js',
watch: true,
output: {
path: path.resolve(__dirname, 'js'),
filename: 'init.min.js'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: [/node_modules/],
query: {
presets: ['es2015'],
plugins: ["transform-object-assign", "transform-runtime"]
}
}
],
rules: [
{
test: /\.js$/, // include .js files
enforce: "pre", // preload the jshint loader
exclude: /node_modules/, // exclude any and all files in the node_modules folder
use: [
{
loader: "jshint-loader"
}
],
}
]
},
jshint: {
// any jshint option http://www.jshint.com/docs/options/
// i. e.
camelcase: true,
// jshint errors are displayed by default as warnings
// set emitErrors to true to display them as errors
emitErrors: false,
// jshint to not interrupt the compilation
// if you want any file with jshint errors to fail
// set failOnHint to true
failOnHint: false,
// custom reporter function
reporter: function(errors) { }
},
stats: {
colors: true
},
//devtool: 'source-map'
};
The text was updated successfully, but these errors were encountered:
I believe the documentation is incorrect, as the code example gives an error.
What kind of issue are you submitting?
Bug Report
Please tell us your
Use this configuration and run
webpack
:The text was updated successfully, but these errors were encountered: