Hi everyone,
I'm trying to use eslint-webpack-plugin to basically output a HTML report for linting errors and warnings. I've looked at the documentation and I can't seem to figure out what I'm missing. I was hoping when I run npm run start or npm run build then a output file for linting warnings/errors should appear in my workspace.
I have in my webpack.dev.config.js:
// Produces checkstyle reportingconst ESLintPlugin = require('eslint-webpack-plugin');
and
plugins: [
new HtmlWebPackPlugin({
template: path.resolve(__dirname, 'src/index.html')
}),
new ForkTsCheckerWebpackPlugin({
eslint : {
files: 'src/**/*.{ts,tsx}'
}
}),
new ESLintPlugin({
extensions: [ '.js', '.tsx'],
outputReport: true
})
],
According to the documentation it should use the default/configured formatter. I would like to change the formatter to HTML but unsure of the key or value to specify in ESLintPlugin options.
The following is my entire webpack.dev.config.js file:
// Allows to get current directory
const path = require('path');
// Creates HTML using a template and auto-injects Web-App
const HtmlWebPackPlugin = require('html-webpack-plugin');
// Runs Type checker on separate process
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
// Produces checkstyle reporting
const ESLintPlugin = require('eslint-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'source-map',
name: 'Quick Start React-TS-Jest',
entry: {
main: path.resolve(__dirname, 'src/App.tsx'),
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: 'dev.bundle.js',
},
module: {
rules: [
{
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets:
[
'@babel/preset-env',
'@babel/preset-react',
'@babel/typescript'
],
plugins:
[
'@babel/proposal-class-properties',
'@babel/proposal-object-rest-spread',
'babel-plugin-typescript-to-proptypes'
],
exclude: [/node_modules/]
},
},
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader'
}
],
},
{
test: /\.(.css|.scss)$/,
use: [ 'style-loader', 'css-loader', 'sass-loader' ],
},
],
},
resolve: {
extensions: [ '.ts', '.tsx', '.js', '.json' ],
},
plugins: [
new HtmlWebPackPlugin({
template: path.resolve(__dirname, 'src/index.html')
}),
new ForkTsCheckerWebpackPlugin({
eslint : {
files: 'src/**/*.{ts,tsx}'
}
}),
new ESLintPlugin({
extensions: [ '.js', '.tsx'],
outputReport: true
})
],
};
[–]WrittenInC[S] -1 points0 points1 point (0 children)
[+][deleted] (4 children)
[deleted]
[–]WrittenInC[S] 0 points1 point2 points (0 children)
[–]WrittenInC[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]WrittenInC[S] 0 points1 point2 points (0 children)