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

Commit

Permalink
merge in 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianSipple authored and BrianSipple committed May 31, 2016
2 parents dcf7726 + e697038 commit bcbea2a
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# 1.4.1 / 30-05-2016
- Remove `eslint-config-ember` and `phantomjs` from `devDependencies`.

# 1.4.0 / 14-05-2016
- Root configuration no longer relies on `eslint-config-ember`. (Discussion around appropriate base configuration is [still ongoing](https://github.com/ember-cli/ember-cli-eslint/pull/61))
- Default blueprint now generates `.eslintrc.js` and `tests/.eslintrc.js` (`.eslintrc` has been [deprecated](http://eslint.org/docs/user-guide/configuring#configuration-file-formats).
- **Potential Changes:** If you have a `.eslintrc` or `tests/.eslintrc` file, please reformat it to be a `.eslintrc.js` file (using `module.exports`) so that `ember-cli-eslint` can detect potential duplicates.
- Base root configuration now extends from `eslint:recommended`.
- Base `/test` configuration now defines `embertest: true` as an `env` setting.

Expand Down
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,51 @@ ember install ember-cli-eslint

This will create a `.eslintrc.js` file in the root of your project, and another `.eslintrc.js` file inside of `/test`. These files extend from our recommended configurations for [Ember application code](/best-practices/ember-application) and [Ember testing code](/best-practices/ember-test), respectively. However, starting from scratch is as easy as deleting the `extends` declaration and [writing your own configuration rules as usual](http://eslint.org/docs/user-guide/configuring).

## Disabling JSHint
Congratulations! You've made the leap into the next generation of JavaScript linting. At the moment, however, `ember-cli` defaults to generating applications and addons with a `jshint` configuration, and so you may initially notice the two awkwardly running side by side. Here are a few tips for handling this:

## Configuring Your Test Runner
#### ember-cli >= 2.5.0
As of `ember-cli v.2.5.0`, [`jshint` is provided through its own `ember-cli-jshint` addon](https://github.com/ember-cli/ember-cli/pull/5757). Running `npm uninstall --save-dev ember-cli-jshint`, in addition to removing any `.jshintrc` files from your project should guarantee that its behavior is disabled.

#### ember-cli < 2.5.0
Controlling linting is a bit trickier on versions of `ember-cli` prior to `2.5.0`. Within your `ember-cli-build.js` file, `ember-cli-qunit` or `ember-cli-mocha` can be configured to have their default linting process disabled during:

```javascript

module.exports = function(defaults) {
const app = new EmberApp(defaults, {
'ember-cli-qunit': {
useLintTree: false
}
});
};

```
or
```javascript
module.exports = function(defaults) {
const app = new EmberApp(defaults, {
'ember-cli-mocha': {
useLintTree: false
}
});
};
```
Alongside this setting, the `hinting` property can then be used to enable/disable globally:

```javascript
const isTesting = process.env.EMBER_ENV === 'test';

module.exports = function(defaults) {
const app = new EmberApp(defaults, {
hinting: !isTesting,
});
};
```
Furthermore, a `.eslintignore` file can be used to exclude files from linting while the linter is running. Its syntax is identical to `.gitignore` files.


## Configuration

ESLint will be run by `ember-cli-qunit` or `ember-cli-mocha` automatically; **no additional configuration is required**. If ESLint is *not* being run automatically, try updating your `ember-cli` or `ember-cli-qunit`/`embe-cli-mocha` version.

Expand All @@ -39,6 +82,7 @@ const app = new EmberApp({

for a more detailed example, you can find the implementation in `ember-cli-qunit` [here](https://github.com/ember-cli/ember-cli-qunit/blob/ba906cacc8674e7c0d6d8ed74223a284dcdebf94/index.js#L192-L203).


## Contributing

### Installation
Expand Down
4 changes: 2 additions & 2 deletions config/eslint-tests.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = {
"extends": "ember",
"extends": "eslint:recommended",
"parser": "babel-eslint",
"rules": {
"arrow-spacing": 0,
Expand All @@ -13,6 +13,6 @@ module.exports = {
"arrow-spacing": 0,
"array-callback-return": 0,
"no-empty-function": 0,
"prefer-rest-params": 0
"prefer-rest-params": 0
}
};
2 changes: 1 addition & 1 deletion config/eslint.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = {
"extends": "ember",
"extends": "eslint:recommended",
"parser": "babel-eslint",
"env": {
"es6": true
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-cli-eslint",
"version": "1.4.0",
"version": "1.4.1",
"description": "Ember-cli eslint support, for checking your application matches your coding standards.",
"directories": {
"doc": "doc",
Expand Down Expand Up @@ -43,10 +43,8 @@
"ember-load-initializers": "^0.5.0",
"ember-resolver": "^2.0.3",
"ember-try": "^0.1.2",
"eslint-config-ember": "^0.3.0",
"express": "^4.12.3",
"loader.js": "^4.0.0",
"phantomjs": "^2.1.3"
"loader.js": "^4.0.0"
},
"dependencies": {
"babel-eslint": "6.0.4",
Expand Down
1 change: 0 additions & 1 deletion tests/dummy/app/controllers/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extends": "ember",
"rules": {
"no-undef": 0
}
Expand Down

0 comments on commit bcbea2a

Please sign in to comment.