Force build failure on any ESLint Error


#1

Before the switch to ESLint, we were able to fail the build for jsHint errors, using the method described here: Force build failure on any JShint Error

It wasn’t pretty but it worked. Is there a way to do this now with ESLint?


#2

I wold like to add to the question: How to know what is causing the error?

I’m asking because in my particular case, all I get as a message running ember server is the following (no clue of what is wrong):

The Broccoli Plugin: [SimpleConcatConcat] failed with:
Error: Build Canceled: Broccoli Builder ran into an error with EslintValidationFilter plugin. 💥
    at new BroccoliBuildError (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/broccoli-builder/lib/broccoli-build-error.js:40:9)
    at /home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/broccoli-builder/lib/builder.js:168:19
    at tryCatch (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/rsvp/dist/rsvp.js:539:12)
    at invokeCallback (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/rsvp/dist/rsvp.js:554:13)
    at publish (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/rsvp/dist/rsvp.js:522:7)
    at publishRejection (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/rsvp/dist/rsvp.js:457:3)
    at flush (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/rsvp/dist/rsvp.js:2414:5)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

The broccoli plugin was instantiated at: 
    at Concat.Plugin (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/broccoli-plugin/index.js:7:31)
    at new Concat (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/broccoli-concat/concat.js:38:10)
    at module.exports (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/broccoli-concat/index.js:26:10)
    at Function.EslintValidationFilter.create (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/broccoli-lint-eslint/lib/index.js:215:10)
    at Class.lintTree (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/ember-cli-eslint/index.js:44:19)
    at project.addons.map.addon (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/ember-cli/lib/models/addon.js:366:34)
    at Array.map (native)
    at Class._eachProjectAddonInvoke (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/ember-cli/lib/models/addon.js:364:32)
    at Class._lintMirageTree (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/ember-cli-mirage/index.js:81:32)
    at Class.treeForApp (/home/USER/ember-lab/super-rentals-2/super-rentals/node_modules/ember-cli-mirage/index.js:108:23)

#3

I wanted to answer my complement question: My project folder didn’t have the file .eslintrc.js in it (I found the hint at [1]).

This happened to me because I copied the project contents in a new folder cherry-picking the files, to avoid content like dist: but didn’t get the hidden files like .eslintrc.js.

[1] https://github.com/ember-cli/ember-cli/issues/7039