repaired ESLint to work everywhere, plus refactor on all package.json's that included ESLint dependencies.
This commit is contained in:
parent
6c3ac042f1
commit
e20dd82928
|
@ -1,4 +1,4 @@
|
||||||
extends: google
|
extends: [eslint:recommended, google]
|
||||||
installedESLint: true
|
installedESLint: true
|
||||||
rules:
|
rules:
|
||||||
indent: [error, 4]
|
indent: [error, 4]
|
||||||
|
|
|
@ -30,9 +30,10 @@
|
||||||
"cors": "^2.8.1",
|
"cors": "^2.8.1",
|
||||||
"css-loader": "^0.25.0",
|
"css-loader": "^0.25.0",
|
||||||
"del": "^2.2.2",
|
"del": "^2.2.2",
|
||||||
"eslint": "^3.16.1",
|
"eslint": "^3.19.0",
|
||||||
"eslint-config-angular": "^0.5.0",
|
"eslint-config-angular": "^0.5.0",
|
||||||
"eslint-config-google": "^0.6.0",
|
"eslint-config-google": "^0.6.0",
|
||||||
|
"eslint-config-loopback": "^4.0.0",
|
||||||
"eslint-config-xo": "^0.17.0",
|
"eslint-config-xo": "^0.17.0",
|
||||||
"eslint-plugin-angular": "^1.4.1",
|
"eslint-plugin-angular": "^1.4.1",
|
||||||
"file-loader": "^0.9.0",
|
"file-loader": "^0.9.0",
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
"strong-error-handler": "^2.1.0"
|
"strong-error-handler": "^2.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^2.13.1",
|
|
||||||
"eslint-config-loopback": "^4.0.0",
|
|
||||||
"nsp": "^2.1.0"
|
"nsp": "^2.1.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
var app = require('../../../server/server');
|
var app = require('../../../server/server');
|
||||||
|
|
||||||
module.exports = function(Client){
|
module.exports = function(Client) {
|
||||||
Client.remoteMethod('createUserProfile', {
|
Client.remoteMethod('createUserProfile', {
|
||||||
description: 'Creates both client and its web account',
|
description: 'Creates both client and its web account',
|
||||||
accepts: {
|
accepts: {
|
||||||
arg: 'data',
|
arg: 'data',
|
||||||
type: 'object',
|
type: 'object',
|
||||||
http: { source: 'body' }
|
http: {source: 'body'}
|
||||||
},
|
},
|
||||||
returns: {
|
returns: {
|
||||||
root: true,
|
root: true,
|
||||||
|
@ -17,7 +17,7 @@ module.exports = function(Client){
|
||||||
path: '/createUserProfile'
|
path: '/createUserProfile'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Client.createUserProfile = (data, callback) => {
|
Client.createUserProfile = (data, callback) => {
|
||||||
let firstEmail = data.email.split(',')[0];
|
let firstEmail = data.email.split(',')[0];
|
||||||
let user = {
|
let user = {
|
||||||
|
@ -26,11 +26,11 @@ module.exports = function(Client){
|
||||||
password: parseInt(Math.random() * 100000000000000)
|
password: parseInt(Math.random() * 100000000000000)
|
||||||
};
|
};
|
||||||
|
|
||||||
app.models.Account.beginTransaction('READ COMMITTED', (err, transaction) => {
|
app.models.Account.beginTransaction('READ COMMITTED', (error, transaction) => {
|
||||||
app.models.Account.create(user, {transaction}, (err, account) => {
|
app.models.Account.create(user, {transaction}, (error, account) => {
|
||||||
if (err) {
|
if (error) {
|
||||||
transaction.rollback();
|
transaction.rollback();
|
||||||
return callback(err);
|
return callback(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
let client = {
|
let client = {
|
||||||
|
@ -41,10 +41,10 @@ module.exports = function(Client){
|
||||||
email: data.email
|
email: data.email
|
||||||
};
|
};
|
||||||
|
|
||||||
Client.create(client, {transaction}, (err, client) => {
|
Client.create(client, {transaction}, (error, client) => {
|
||||||
if (err) {
|
if (error) {
|
||||||
transaction.rollback();
|
transaction.rollback();
|
||||||
return callback(err);
|
return callback(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
transaction.commit();
|
transaction.commit();
|
||||||
|
@ -53,4 +53,4 @@ module.exports = function(Client){
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "server/server.js",
|
"main": "server/server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint .",
|
|
||||||
"start": "node .",
|
"start": "node .",
|
||||||
"posttest": "npm run lint && nsp check"
|
"posttest": "npm run lint && nsp check"
|
||||||
},
|
},
|
||||||
|
@ -21,8 +20,6 @@
|
||||||
"strong-error-handler": "^2.1.0"
|
"strong-error-handler": "^2.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^2.13.1",
|
|
||||||
"eslint-config-loopback": "^4.0.0",
|
|
||||||
"nsp": "^2.1.0"
|
"nsp": "^2.1.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
"strong-error-handler": "^2.1.0"
|
"strong-error-handler": "^2.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^2.13.1",
|
|
||||||
"eslint-config-loopback": "^4.0.0",
|
|
||||||
"nsp": "^2.1.0"
|
"nsp": "^2.1.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
"strong-error-handler": "^2.1.0"
|
"strong-error-handler": "^2.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^2.13.1",
|
|
||||||
"eslint-config-loopback": "^4.0.0",
|
|
||||||
"nsp": "^2.1.0"
|
"nsp": "^2.1.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
Loading…
Reference in New Issue