Skip to content

Commit

Permalink
Replace JSHint with ESLint (#33)
Browse files Browse the repository at this point in the history
* Replace JSHint with ESLint

* ESLint: Enable more rules
  • Loading branch information
Turbo87 authored and marcoow committed Jan 3, 2017
1 parent 2cd2d30 commit 7368541
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
root: true,
env: {
node: true
},
extends: 'eslint:recommended',
rules: {
// --- Possible Errors ---

'no-template-curly-in-string': 'error',
'no-unsafe-negation': 'error',

// --- Best Practices ---

'curly': 'error',
'eqeqeq': 'error',
'no-eval': 'error',
'no-extra-bind': 'error',
'no-implicit-coercion': 'error',
'no-implied-eval': 'error',
'no-multi-spaces': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-new': 'error',
'no-return-assign': 'error',
'no-return-await': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-useless-escape': 'error',
'no-void': 'error',
'no-with': 'error',
'require-await': 'error',
'yoda': 'error',

// --- Variables ---

'no-use-before-define': ['error', 'nofunc']
}
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scripts": {
"build": "ember build",
"lint": "jshint config test-support tests *.js",
"lint": "eslint config test-support tests *.js",
"start": "ember server",
"test": "ember try:each"
},
Expand Down Expand Up @@ -37,7 +37,7 @@
"ember-export-application-global": "^1.0.5",
"ember-load-initializers": "^0.5.1",
"ember-resolver": "^2.0.3",
"jshint": "^2.9.4",
"eslint": "^3.12.2",
"loader.js": "^4.0.10"
},
"keywords": [
Expand Down
11 changes: 11 additions & 0 deletions test-support/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
env: {
node: null,
browser: true,
embertest: true,
},
};
11 changes: 11 additions & 0 deletions tests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
env: {
node: null,
browser: true,
embertest: true,
},
};
4 changes: 2 additions & 2 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* jshint node: true */
/* eslint-env node */

module.exports = function(environment) {
var ENV = {
Expand Down Expand Up @@ -43,7 +43,7 @@ module.exports = function(environment) {
}

if (environment === 'production') {

// nothing yet...
}

return ENV;
Expand Down

0 comments on commit 7368541

Please sign in to comment.