Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #87 from martndemus/allow-turn-off-linting
Browse files Browse the repository at this point in the history
Allow turning off linting
  • Loading branch information
rwjblue committed Nov 10, 2015
2 parents 2d7f076 + 6da2b39 commit 7fdb4e8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ models, controllers, components, etc. in order to generate the corresponding Moc
Tests rely on [ember-mocha](https://github.com/switchfly/ember-mocha) modules
and helpers. Please refer to that project to understand detailed usage.

## Turning of JSHint linting

If you want to turn off JSHint linting you can do the following configuration in your ember-cli-build.js file:

```
var app = new EmberApp({
'babel': {
optional: ['es7.decorators']
},
'ember-cli-mocha': {
useLintTree: false
}
});
```

## Copyright and License

Copyright 2014 Switchfly
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ module.exports = {
},

lintTree: function(type, tree) {
// Skip if useLintTree === false.
if (this.options['ember-cli-mocha'] && this.options['ember-cli-mocha'].useLintTree === false) {
// Fakes an empty broccoli tree
return { inputTree: tree, rebuild: function() { return []; } };
}

return jshintTrees(tree, {
jshintrcPath: this.jshintrc[type],
description: 'JSHint ' + type + '- Mocha',
Expand Down

4 comments on commit 7fdb4e8

@octosteve
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwjblue Not sure why, but this change is preventing a new project from running.

ember new foo
cd foo
ember install ember-cli-mocha
ember test

Is anyone getting something similar?

@octosteve
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot read property 'ember-cli-mocha' of undefinedis the error

@rwjblue
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StevenNunez - Seems like this.options is undefined. Can you open an issue?

@rwjblue
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like #88 was reported already.

Please sign in to comment.