Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add throwOnError and throwOnWarn options #231

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ let app = new EmberApp(defaults, {
group: true,
rulesDir: 'eslint-rules',
extensions: ['js'],
throwOnError: true,
throwOnWarn: true,
}
});
```
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down