Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class ESLintWebpackPlugin {
// Generate key for each compilation,
// this differentiates one from the other when being cached.
this.key = compiler.name || `${this.key}_${(compilerId += 1)}`;
this.options.failOnError ??= compiler.options.mode !== "development";

const excludedFiles = parseFiles(
this.options.exclude || [],
Expand Down
1 change: 0 additions & 1 deletion src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ function getOptions(pluginOptions) {
extensions: "js",
emitError: true,
emitWarning: true,
failOnError: true,
resourceQueryExclude: [],
...pluginOptions,
...(pluginOptions.quiet ? { emitError: true, emitWarning: false } : {}),
Expand Down
6 changes: 6 additions & 0 deletions test/multiple-instances.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe("multiple instances", () => {
{
plugins: [
new ESLintPlugin({
failOnError: true,
overrideConfigFile: join(
__dirname,
"./config-for-tests/eslint.config.mjs",
Expand All @@ -18,6 +19,7 @@ describe("multiple instances", () => {
exclude: "error.js",
}),
new ESLintPlugin({
failOnError: true,
overrideConfigFile: join(
__dirname,
"./config-for-tests/eslint.config.mjs",
Expand All @@ -41,6 +43,7 @@ describe("multiple instances", () => {
{
plugins: [
new ESLintPlugin({
failOnError: true,
overrideConfigFile: join(
__dirname,
"./config-for-tests/eslint.config.mjs",
Expand All @@ -49,6 +52,7 @@ describe("multiple instances", () => {
exclude: "good.js",
}),
new ESLintPlugin({
failOnError: true,
overrideConfigFile: join(
__dirname,
"./config-for-tests/eslint.config.mjs",
Expand All @@ -70,6 +74,7 @@ describe("multiple instances", () => {
{
plugins: [
new ESLintPlugin({
failOnError: true,
overrideConfigFile: join(
__dirname,
"./config-for-tests/eslint.config.mjs",
Expand All @@ -78,6 +83,7 @@ describe("multiple instances", () => {
exclude: "error.js",
}),
new ESLintPlugin({
failOnError: true,
overrideConfigFile: join(
__dirname,
"./config-for-tests/eslint.config.mjs",
Expand Down
1 change: 0 additions & 1 deletion test/utils/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default (entry, pluginConf = {}, webpackConf = {}) => {
ignore: false,
// TODO: update tests to run both states: test.each([[{threads: false}], [{threads: true}]])('it should...', async ({threads}) => {...})
threads: true,
failOnError: false,
...pluginConf,
}),
],
Expand Down