Skip to content

Commit 87f0527

Browse files
author
Parth Shah
committed
fixing lint errors
1 parent 60f3ce0 commit 87f0527

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3879
-3882
lines changed

.eslintrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": "airbnb",
3+
"parser": "babel-eslint",
4+
"env": {
5+
"browser": false,
6+
"node": true,
7+
"es6": true,
8+
"mocha": true
9+
},
10+
"rules": {
11+
"valid-jsdoc": ["error", {
12+
"requireReturn": true,
13+
"requireReturnType": true,
14+
"requireParamDescription": true,
15+
"requireReturnDescription": true
16+
}],
17+
"require-jsdoc": ["error", {
18+
"require": {
19+
"FunctionDeclaration": true,
20+
"MethodDefinition": true,
21+
"ClassDeclaration": true
22+
}
23+
}]
24+
}
25+
}

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Microservice to manage CRUD operations for all things Projects.
77
* Nodejs 6.9.4 - consider using [nvm](https://github.com/creationix/nvm) or equivalent to manage your node version
88
* Install [libpg](https://www.npmjs.com/package/pg-native)
99
* Install node dependencies
10-
`npm install | ./node_modules/.bin/bunyan`
10+
`npm install`
1111

1212
* Start local services
1313
```~/Projects/tc-projects-service
@@ -21,12 +21,9 @@ Copy config/sample.local.js as config/local.js, update the properties and accord
2121
Once you start your PostgreSQL database through docker, it will create a projectsDB.
2222
*To create tables - note this will drop tables if they already exist*
2323
```
24-
npm run -s build
25-
> NODE_ENV=development node -e "require('./dist/models').default.sequelize.sync({force: true}).then((res)=> console.log('Success: ', res)).catch((err)=> console.log('Failed: ', err));"
24+
NODE_ENV=local npm run sync
2625
```
2726

28-
Other simple approach to create tables is to run `npm run sync` from root of project. This additional script is added to make the above task simpler.
29-
3027
#### Redis
3128
Docker compose command will start a local redis instance as well. You should be able to connect to this instance using url `$(docker-machine ip):6379`
3229

@@ -55,6 +52,3 @@ You can paste **swagger.yaml** to [swagger editor](http://editor.swagger.io/) o
5552

5653
#### Deploying without docker
5754
If you don't want to use docker to deploy to localhost. You can simply run `npm run start` from root of project. This should start the server on default port `3000`.
58-
59-
### Deployment
60-
Using awsebcli - http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html

sync.js renamed to migrations/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Make sure we are in development mode
99
* @type {String}
1010
*/
11-
process.env.NODE_ENV = 'development'
11+
// process.env.NODE_ENV = 'development'
1212

1313
require('./dist/models').default.sequelize.sync({ force: true })
1414
.then(() => {

package.json

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
"node": ">=6.9"
88
},
99
"scripts": {
10-
"test": "NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha -- --compilers js:babel-core/register $(find src -path '*spec.js*')",
11-
"live-test": "NODE_ENV=test ./node_modules/.bin/mocha -w --compilers js:babel-core/register $(find src -path '*spec.js*')",
12-
"dev": "NODE_ENV=local PORT=8001 nodemon -w src --exec \"babel-node src --presets es2015\" | ./node_modules/.bin/bunyan",
1310
"build": "babel src -d dist --presets es2015",
14-
"start": "node dist",
11+
"sync": "node migrations/sync.js",
12+
"lint": "./node_modules/.bin/eslint src",
1513
"prestart": "npm run -s build",
14+
"start": "node dist",
15+
"start:dev": "NODE_ENV=local PORT=8001 nodemon -w src --exec \"babel-node src --presets es2015\" | ./node_modules/.bin/bunyan",
16+
"test": "NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha -- --compilers js:babel-core/register $(find src -path '*spec.js*')",
17+
"test:watch": "NODE_ENV=test ./node_modules/.bin/mocha -w --compilers js:babel-core/register $(find src -path '*spec.js*')",
1618
"seed": "babel-node src/tests/seed.js --presets es2015",
17-
"direct": "babel-node src/mocks/direct.js --presets es2015",
18-
"sync": "node sync.js",
19-
"lint": "./node_modules/.bin/eslint src"
19+
"direct": "babel-node src/mocks/direct.js --presets es2015"
2020
},
2121
"repository": {
2222
"type": "git",
@@ -28,25 +28,6 @@
2828
"url": "https://github.com/appirio-tech/tc-projects-service/issues"
2929
},
3030
"homepage": "https://github.com/appirio-tech/tc-projects-service#readme",
31-
"eslintConfig": {
32-
"plugins": [],
33-
"extends": "eslint:recommended",
34-
"parserOptions": {
35-
"ecmaVersion": 7,
36-
"sourceType": "module"
37-
},
38-
"env": {
39-
"node": true,
40-
"mocha": true
41-
},
42-
"globals": {
43-
"Promise": true
44-
},
45-
"rules": {
46-
"no-console": 0,
47-
"no-unused-vars": 1
48-
}
49-
},
5031
"dependencies": {
5132
"amqplib": "^0.5.1",
5233
"analytics-node": "^2.1.1",
@@ -71,12 +52,16 @@
7152
"devDependencies": {
7253
"babel-cli": "^6.9.0",
7354
"babel-core": "^6.11.4",
55+
"babel-eslint": "^7.1.1",
7456
"babel-plugin-add-module-exports": "^0.2.1",
7557
"babel-preset-es2015": "^6.9.0",
7658
"bunyan": "^1.8.1",
7759
"chai": "^3.5.0",
7860
"eslint": "^3.2.2",
79-
"eslint-plugin-import": "^1.12.0",
61+
"eslint-config-airbnb": "^14.1.0",
62+
"eslint-plugin-import": "^2.2.0",
63+
"eslint-plugin-jsx-a11y": "^4.0.0",
64+
"eslint-plugin-react": "^6.10.0",
8065
"istanbul": "^1.0.0-alpha.2",
8166
"mocha": "^2.5.3",
8267
"nodemon": "^1.9.1",

0 commit comments

Comments
 (0)