diff --git a/README.md b/README.md index 99dd3887..678bbd59 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,8 @@ let app = new EmberApp(defaults, { group: true, rulesDir: 'eslint-rules', extensions: ['js'], + throwOnError: true, + throwOnWarn: true, } }); ``` @@ -146,6 +148,11 @@ let app = new EmberApp(defaults, { - `extensions` is an array containing the file extensions to lint. If you want to lint JavaScript and TypeScript files for example it should be set to `['js', 'ts']`. _NOTE_: If you add Typescript files `typescript-eslint-parser` has to be installed and specified as the parser. For more information take a look at the [`typescript-eslint-parser`](https://github.com/eslint/typescript-eslint-parser) +- `throwOnError` can be set to `true` to cause builds to fail on first eslint rule violation with `error`-level severity + +- `throwOnWarn` can be set to `true` to cause builds to fail on first eslint rule violation with `warn`-level severity. _NOTE_: Setting this to true will automatically enable `throwOnError` behavior + + ### On Build Files Please note that if you are using this to lint files which are part of the build diff --git a/index.js b/index.js index 94098b66..7741d3b9 100644 --- a/index.js +++ b/index.js @@ -45,6 +45,8 @@ module.exports = { testGenerator: this.options.testGenerator || this._testGenerator, group: (this.options.group !== false) ? type : undefined, extensions: this.options.extensions, + throwOnError: this.options.throwOnError, + throwOnWarn: this.options.throwOnWarn, options: { rulesDir: this.options.rulesDir || 'eslint-rules'