repaired ESLint to work everywhere, plus refactor on all package.json's that included ESLint dependencies.

This commit is contained in:
Carlos 2017-09-20 13:15:12 +02:00
parent 6c3ac042f1
commit e20dd82928
7 changed files with 14 additions and 22 deletions

View File

@ -1,4 +1,4 @@
extends: google
extends: [eslint:recommended, google]
installedESLint: true
rules:
indent: [error, 4]

View File

@ -30,9 +30,10 @@
"cors": "^2.8.1",
"css-loader": "^0.25.0",
"del": "^2.2.2",
"eslint": "^3.16.1",
"eslint": "^3.19.0",
"eslint-config-angular": "^0.5.0",
"eslint-config-google": "^0.6.0",
"eslint-config-loopback": "^4.0.0",
"eslint-config-xo": "^0.17.0",
"eslint-plugin-angular": "^1.4.1",
"file-loader": "^0.9.0",

View File

@ -21,8 +21,6 @@
"strong-error-handler": "^2.1.0"
},
"devDependencies": {
"eslint": "^2.13.1",
"eslint-config-loopback": "^4.0.0",
"nsp": "^2.1.0"
},
"repository": {

View File

@ -1,12 +1,12 @@
var app = require('../../../server/server');
module.exports = function(Client){
module.exports = function(Client) {
Client.remoteMethod('createUserProfile', {
description: 'Creates both client and its web account',
accepts: {
arg: 'data',
type: 'object',
http: { source: 'body' }
http: {source: 'body'}
},
returns: {
root: true,
@ -17,7 +17,7 @@ module.exports = function(Client){
path: '/createUserProfile'
}
});
Client.createUserProfile = (data, callback) => {
let firstEmail = data.email.split(',')[0];
let user = {
@ -26,11 +26,11 @@ module.exports = function(Client){
password: parseInt(Math.random() * 100000000000000)
};
app.models.Account.beginTransaction('READ COMMITTED', (err, transaction) => {
app.models.Account.create(user, {transaction}, (err, account) => {
if (err) {
app.models.Account.beginTransaction('READ COMMITTED', (error, transaction) => {
app.models.Account.create(user, {transaction}, (error, account) => {
if (error) {
transaction.rollback();
return callback(err);
return callback(error);
}
let client = {
@ -41,10 +41,10 @@ module.exports = function(Client){
email: data.email
};
Client.create(client, {transaction}, (err, client) => {
if (err) {
Client.create(client, {transaction}, (error, client) => {
if (error) {
transaction.rollback();
return callback(err);
return callback(error);
}
transaction.commit();
@ -53,4 +53,4 @@ module.exports = function(Client){
});
});
};
};
};

View File

@ -3,7 +3,6 @@
"version": "1.0.0",
"main": "server/server.js",
"scripts": {
"lint": "eslint .",
"start": "node .",
"posttest": "npm run lint && nsp check"
},
@ -21,8 +20,6 @@
"strong-error-handler": "^2.1.0"
},
"devDependencies": {
"eslint": "^2.13.1",
"eslint-config-loopback": "^4.0.0",
"nsp": "^2.1.0"
},
"repository": {

View File

@ -22,8 +22,6 @@
"strong-error-handler": "^2.1.0"
},
"devDependencies": {
"eslint": "^2.13.1",
"eslint-config-loopback": "^4.0.0",
"nsp": "^2.1.0"
},
"repository": {

View File

@ -21,8 +21,6 @@
"strong-error-handler": "^2.1.0"
},
"devDependencies": {
"eslint": "^2.13.1",
"eslint-config-loopback": "^4.0.0",
"nsp": "^2.1.0"
},
"repository": {