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 installedESLint: true
rules: rules:
indent: [error, 4] indent: [error, 4]

View File

@ -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",

View File

@ -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": {

View File

@ -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,
@ -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();

View File

@ -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": {

View File

@ -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": {

View File

@ -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": {