-
Notifications
You must be signed in to change notification settings - Fork 56
fix lint errors #46
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
fix lint errors #46
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,5 @@ | ||
node_modules | ||
dist | ||
.ebextensions | ||
.elasticbeanstalk | ||
coverage |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,21 @@ | |
"mocha": true | ||
}, | ||
"rules": { | ||
"no-param-reassign": 0, | ||
"global-require": 0, | ||
"func-names": 0, | ||
"no-mixed-operators": 0, | ||
"consistent-return": 0, | ||
"no-unused-expressions": 0, | ||
"newline-per-chained-call": 0, | ||
"no-underscore-dangle": 0, | ||
"import/no-extraneous-dependencies": ["error", {"devDependencies": true, "optionalDependencies": false, "peerDependencies": false}], | ||
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've changed this to |
||
"max-len": ["error", { | ||
"code": 120, | ||
"ignoreComments": true, | ||
"ignoreTrailingComments": true, | ||
"tabWidth": 2 | ||
}], | ||
"valid-jsdoc": ["error", { | ||
"requireReturn": true, | ||
"requireReturnType": true, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
// force using test.json for unit tests | ||
|
||
var config | ||
let config; | ||
if (process.env.NODE_ENV === 'test') { | ||
config = require('./test.json') | ||
config = require('./test.json'); | ||
} else { | ||
config = { | ||
"authSecret": "secret", | ||
"logLevel": "debug", | ||
"captureLogs": "false", | ||
"logentriesToken": "", | ||
"rabbitmqURL": "amqp://dockerhost:5672", | ||
"fileServiceEndpoint": "https://api.topcoder-dev.com/v3/files/", | ||
"topicServiceEndpoint": "https://api.topcoder-dev.com/v4/topics/", | ||
"directProjectServiceEndpoint": "https://api.topcoder-dev.com/v3/direct", | ||
"userServiceUrl": "https://api.topcoder-dev.com/v3/users", | ||
"connectProjectsUrl": "https://connect.topcoder-dev.com/projects/", | ||
"salesforceLead" : { | ||
"webToLeadUrl": 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', | ||
"orgId": "00D2C0000000dO6", | ||
"projectNameFieldId": "title", | ||
"projectDescFieldId": "description", | ||
"projectLinkFieldId": "URL", | ||
"projectIdFieldId" : "00N2C000000Vxxx" | ||
}, | ||
"dbConfig": { | ||
"masterUrl": "postgres://coder:mysecretpassword@dockerhost:5432/projectsdb", | ||
"maxPoolSize": 50, | ||
"minPoolSize": 4, | ||
"idleTimeout": 1000 | ||
} | ||
} | ||
authSecret: 'secret', | ||
logLevel: 'debug', | ||
captureLogs: 'false', | ||
logentriesToken: '', | ||
rabbitmqURL: 'amqp://dockerhost:5672', | ||
fileServiceEndpoint: 'https://api.topcoder-dev.com/v3/files/', | ||
topicServiceEndpoint: 'https://api.topcoder-dev.com/v4/topics/', | ||
directProjectServiceEndpoint: 'https://api.topcoder-dev.com/v3/direct', | ||
userServiceUrl: 'https://api.topcoder-dev.com/v3/users', | ||
connectProjectsUrl: 'https://connect.topcoder-dev.com/projects/', | ||
salesforceLead: { | ||
webToLeadUrl: 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', | ||
orgId: '00D2C0000000dO6', | ||
projectNameFieldId: 'title', | ||
projectDescFieldId: 'description', | ||
projectLinkFieldId: 'URL', | ||
projectIdFieldId: '00N2C000000Vxxx', | ||
}, | ||
dbConfig: { | ||
masterUrl: 'postgres://coder:mysecretpassword@dockerhost:5432/projectsdb', | ||
maxPoolSize: 50, | ||
minPoolSize: 4, | ||
idleTimeout: 1000, | ||
}, | ||
}; | ||
} | ||
module.exports = config | ||
module.exports = config; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
'use strict' | ||
|
||
/** | ||
* Sync the database models to db tables. | ||
*/ | ||
|
||
import winston from 'winston'; | ||
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. we are using bunyan not winston |
||
|
||
/** | ||
* Make sure we are in development mode | ||
* @type {String} | ||
*/ | ||
// process.env.NODE_ENV = 'development' | ||
|
||
require('./dist/models').default.sequelize.sync({ force: true }) | ||
require('../dist/models').default.sequelize.sync({ force: true }) | ||
.then(() => { | ||
console.log('Database synced successfully') | ||
process.exit() | ||
winston.info('Database synced successfully'); | ||
process.exit(); | ||
}).catch((err) => { | ||
console.error('Error syncing database', err) | ||
process.exit(1) | ||
}) | ||
winston.error('Error syncing database', err); | ||
process.exit(1); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,8 @@ | |
"scripts": { | ||
"build": "babel src -d dist --presets es2015", | ||
"sync": "node migrations/sync.js", | ||
"lint": "./node_modules/.bin/eslint src", | ||
"lint": "./node_modules/.bin/eslint .", | ||
"lint:fix": "./node_modules/.bin/eslint . --fix || true", | ||
"prestart": "npm run -s build", | ||
"start": "node dist", | ||
"start:dev": "NODE_ENV=local PORT=8001 nodemon -w src --exec \"babel-node src --presets es2015\" | ./node_modules/.bin/bunyan", | ||
|
@@ -47,7 +48,8 @@ | |
"pg": "^4.5.5", | ||
"pg-native": "^1.10.0", | ||
"sequelize": "^3.23.0", | ||
"tc-core-library-js": "^1.0.8" | ||
"tc-core-library-js": "^1.0.8", | ||
"winston": "^2.3.1" | ||
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. remove winston dependency |
||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.9.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
/* eslint-disable max-len */ | ||
import winston from 'winston'; | ||
|
||
const http = require('https'); | ||
|
||
const options = { | ||
|
@@ -23,7 +26,7 @@ const req = http.request(options, (res) => { | |
|
||
res.on('end', () => { | ||
const body = Buffer.concat(chunks); | ||
console.log(body.toString()); | ||
winston.info(body.toString()); | ||
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. please don't use winston logger |
||
}); | ||
}); | ||
req.write('{\n "billingAccountId": 123456789\n}'); | ||
|
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.
We want to use the default settings with eslint-config-airbnb base. Please don't modify the lint rules.