Repository URL to install this package:
|
Version:
1.2.10 ▾
|
/**
* @see https://survivejs.com/webpack/developing/linting/
*/
import { Configuration, Options } from '../../../typings'
/**
* @see https://github.com/MoOx/eslint-loader#quiet-default-false
*/
const ruleOptions = {
failOnWarning: false,
failOnError: false,
quiet: true,
}
const rule = {
test: /\.jsx?$/,
loader: 'eslint-loader',
exclude: /node_modules|modules/,
options: ruleOptions,
}
/**
* @todo Output to Jenkins compatible XML
* @example
* outputReport: {
* filePath: 'checkstyle.xml',
* formatter: require('eslint/lib/formatters/checkstyle'),
* }
*/
export default function eslintPlugin(config: Configuration, options: Options) {
if (options.isDev !== true) return
if (process.env.ESLINT) {
config.module.rules.push(rule)
}
}