-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Switch to Babel parser & Change JSHint to ESLint & Drop Support for Node 6 #61
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/tests/fixtures/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
module.exports = { | ||
root: true, | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
}, | ||
plugins: ['mocha', 'node'], | ||
extends: ['eslint:recommended', 'plugin:node/recommended', 'prettier'], | ||
env: { | ||
browser: false, | ||
node: true, | ||
es6: true, | ||
}, | ||
globals: {}, | ||
rules: { | ||
/*** For compatibility with existing source */ | ||
'no-var': 0, | ||
'no-undef': 0, | ||
'strict': 0, | ||
'object-shorthand': 0, | ||
'no-lonely-if': 0, | ||
|
||
/*** Possible Errors ***/ | ||
|
||
'no-console': 0, | ||
'no-template-curly-in-string': 2, | ||
'no-unsafe-negation': 2, | ||
|
||
/*** Best Practices ***/ | ||
|
||
curly: 2, | ||
eqeqeq: 2, | ||
'guard-for-in': 0, | ||
'no-caller': 2, | ||
'no-eq-null': 2, | ||
'no-eval': 2, | ||
'no-new': 0, | ||
'no-unused-expressions': [ | ||
2, | ||
{ | ||
allowShortCircuit: true, | ||
allowTernary: true, | ||
}, | ||
], | ||
'wrap-iife': 0, | ||
yoda: 2, | ||
|
||
/*** Variables ***/ | ||
|
||
'no-unused-vars': 2, | ||
'no-use-before-define': [2, 'nofunc'], | ||
|
||
/*** Stylistic Issues ***/ | ||
|
||
camelcase: 2, | ||
'new-cap': [2, { properties: false }], | ||
'no-array-constructor': 2, | ||
'no-bitwise': 2, | ||
'no-plusplus': 0, | ||
'no-unneeded-ternary': 2, | ||
|
||
/*** ECMAScript 6 ***/ | ||
|
||
'no-useless-computed-key': 2, | ||
'prefer-template': 2, | ||
'symbol-description': 2, | ||
}, | ||
}; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
singleQuote: true, | ||
trailingComma: 'es5', | ||
printWidth: 120, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- '6' | ||
- '8' | ||
- '10' | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,14 +19,20 @@ | |
"url": "https://github.com/ember-cli/ember-router-generator.git" | ||
}, | ||
"dependencies": { | ||
"@babel/parser": "^7.4.5", | ||
"@babel/traverse": "^7.4.5", | ||
"recast": "^0.18.1" | ||
}, | ||
"devDependencies": { | ||
"assertion-error": "^1.1.0", | ||
"chai": "^4.2.0", | ||
"esprima": "^2.7.2", | ||
"eslint": "^6.0.1", | ||
"eslint-config-prettier": "^6.0.0", | ||
"eslint-plugin-mocha": "^5.3.0", | ||
"eslint-plugin-node": "^9.1.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if it's not too much work, could you extract the JSHint->ESLint change to a separate PR? that would make the parser changes here significantly easier to review 🙏 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to separate it completely but it was non-trivial because some of the code in this PR was incompatible with the old version of jshint. I tried to make the code changes as minimal as possible. If it makes it easier, almost all parser-related changes are in the code, not configuration files (other than the new Babel deps in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sounds like an ordering problem to me. if switching to ESLint is necessary for the code in this PR then why not switch to ESLint first, before modifying any code? I assume the ESLint change does not depend on the new parser code in this PR. |
||
"mocha": "^6.1.4", | ||
"mocha-jshint": "2.3.1" | ||
"mocha-eslint": "^5.0.0", | ||
"prettier": "^1.18.2" | ||
}, | ||
"author": "Adolfo Builes", | ||
"license": "MIT", | ||
|
@@ -35,6 +41,6 @@ | |
}, | ||
"homepage": "https://github.com/ember-cli/ember-router-generator", | ||
"engines": { | ||
"node": "6.* || 8.* || >= 10.*" | ||
"node": "8.* || 10.* || >= 12" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class AppRouter extends Router { | ||
@someDecorator location = config.locationType; | ||
rootURL = config.rootURL; | ||
} | ||
|
||
Router.map(function() { | ||
this.route('foos'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class AppRouter extends Router { | ||
@someDecorator location = config.locationType; | ||
rootURL = config.rootURL; | ||
} | ||
|
||
Router.map(function() { | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
require('mocha-jshint')(); | ||
require('mocha-eslint')(['lib', 'index.js', 'tests/*.js', 'tests/helpers']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be considered a breaking change and will require a new major version release