diff --git a/.eslintrc b/.eslintrc index 8e2160a96..f3fa72dab 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,8 +1,5 @@ { "extends": "loopback", - "parserOptions": { - "ecmaVersion": 5 - }, "rules": { "max-len": ["error", 100, 4, { "ignoreComments": true, diff --git a/index.js b/index.js index 35dd82f55..ec3d87e6f 100644 --- a/index.js +++ b/index.js @@ -8,8 +8,8 @@ * loopback ~ public api */ -var loopback = module.exports = require('./lib/loopback'); -var datasourceJuggler = require('loopback-datasource-juggler'); +const loopback = module.exports = require('./lib/loopback'); +const datasourceJuggler = require('loopback-datasource-juggler'); /** * Connectors diff --git a/package.json b/package.json index 3b6f7d9b1..fdf386843 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,9 @@ "ejs": "^2.3.1", "express": "^4.14.0", "inflection": "^1.6.0", + "isemail": "^1.2.0", "loopback-connector-remote": "^3.0.0", "loopback-datasource-juggler": "^3.0.0", - "isemail": "^1.2.0", "loopback-phase": "^1.2.0", "nodemailer": "^2.5.0", "nodemailer-stub-transport": "^1.0.0", @@ -60,11 +60,12 @@ "underscore.string": "^3.0.3" }, "devDependencies": { + "babel-preset-es2015": "^6.22.0", + "babelify": "^7.3.0", "browserify": "^13.1.0", "chai": "^3.5.0", "cookie-parser": "^1.3.4", "dirty-chai": "^1.2.2", - "es5-shim": "^4.1.0", "eslint-config-loopback": "^7.0.1", "express-session": "^1.14.0", "grunt": "^1.0.1", @@ -78,6 +79,7 @@ "karma": "^1.1.2", "karma-browserify": "^4.4.2", "karma-chrome-launcher": "^1.0.1", + "karma-es6-shim": "^1.0.0", "karma-firefox-launcher": "^1.0.0", "karma-html2js-preprocessor": "^1.0.0", "karma-junit-reporter": "~1.0.0", diff --git a/test/karma.conf.js b/test/karma.conf.js index d9000f4cc..16e5af0e3 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -16,11 +16,10 @@ module.exports = function(config) { basePath: '../', // testing framework to use (jasmine/mocha/qunit/...) - frameworks: ['mocha', 'browserify'], + frameworks: ['es6-shim', 'browserify', 'mocha'], // list of files / patterns to load in the browser files: [ - 'node_modules/es5-shim/es5-shim.js', 'test/loopback.test.js', 'test/model.test.js', // [rfeng] Browserified common/models/application.js @@ -63,6 +62,7 @@ module.exports = function(config) { // Which plugins to enable plugins: [ 'karma-browserify', + 'karma-es6-shim', 'karma-mocha', 'karma-phantomjs-launcher', 'karma-chrome-launcher', @@ -104,7 +104,9 @@ module.exports = function(config) { 'superagent', 'supertest', ], - // transform: ['coffeeify'], + transform: [ + ['babelify', {presets: 'es2015'}], + ], debug: true, // noParse: ['jquery'], watch: true,