UdacityMobileWebScholarship / guess-quote

This application is a collaborative project made by the Google Udacity Mobile Web Specialist Scholars.
MIT License
22 stars 48 forks source link

Let's add eslint for the server code #15

Closed skyshader closed 6 years ago

skyshader commented 6 years ago

I see pull requests with multiple coding style violations in server side code base. My thoughts is to add eslint and configure it as per any recommended standard out there. Let's discuss the possibilities.

anantoghosh commented 6 years ago

I say keep the formatting style same throughout the project. ESlint + Prettier, with pre-commit hook to automatically handle formatting.

ashwani99 commented 6 years ago

Agree with @anantoghosh but I don't think GitHub supports pre-commit hooks. A better solution might be to use CI for checking the linting. It will do the testing for us before PR is merged

skyshader commented 6 years ago

@anantoghosh would you submit the PR with eslint + prettier config in the root repo. Also, do configure husky for setting up pre-commit hook.

See the package.json file of this repository: https://github.com/UdacityMobileWebScholarship/just-notes

@anantoghosh pre-commit hooks are local hooks and are not related to github in any way.

anantoghosh commented 6 years ago

@skyshader I'll submit a PR

skyshader commented 6 years ago

@anantoghosh awesome. Keep us posted. :+1:

anantoghosh commented 6 years ago

Here's the thing, husky requires the .git folder in the same place as package.json.
https://github.com/typicode/husky/blob/dev/docs.md#sub-directory-package

I'll have to add husky on the root package.json and then we can configure for both client and server. Is this fine? @skyshader

skyshader commented 6 years ago

Yep. You're on the right track :+1: