okfn-brasil / perfil-politico-frontend

Front-end that consumes Perfil Político's API
https://perfilpolitico.serenata.ai
GNU General Public License v3.0
31 stars 25 forks source link

Add Linter #3

Closed caiangums closed 5 years ago

caiangums commented 5 years ago

Hey, I've noticed that the project doesn't have a linter. Is it a valid proposal to help with this?

cuducos commented 5 years ago

Is it a valid proposal to help with this?

Sure it is : )

caiangums commented 5 years ago

I can fork the project and place a linter with some basic stuff. I think I can do this on this week before Friday and open the PR.

Is there any template for PR or minimal description that I have to do?

cuducos commented 5 years ago

No template so far. I think the best idea is not only to adopt a linter, but to make sure a CI checks for it and blocks new code to be added if it doesn't respect the linter coding style. I'm not into the JS world but we implemented this scheme in the backend using Black in the CI, so I leave this as a possible reference: https://github.com/okfn-brasil/perfil-politico/pull/54

caiangums commented 5 years ago

I'm familiar with eslint. I'll try to place a CI too and if possible something like a pre-hook(e.g. husky) for this kind of preventing the code being committed/pushed without validating.

I can open the PR and make it in parts so you can check for possible changes or better approaches.

gvarandas commented 5 years ago

Is this solved yet? I could contribute with a simple eslint/husky integration that should work out of the box.

cuducos commented 5 years ago

Is this solved yet?

Not yet, but maybe @caian-gums is working on it. You might want to check with them.

I could contribute with a simple eslint/husky integration that should work out of the box.

Sounds good. I think a pre-commit hook would be great (but optional). Essentially what we need as a first-step is a CI check to throw us a red light when code is not formatted properly ; )

gvarandas commented 5 years ago

@cuducos in my experimentations I also added prettier as a code formatter, which would prevent future typos and mistakes while developing. It integrates very well with eslint and auto format the code for you when saving the file, which is great because it takes one burden off the developer (to decide which code style to follow). Throwing a CI to consume these tasks should not be difficult from now on.

@caian-gums do you have your PR ready to merge or should I move forward on this?

cuducos commented 5 years ago

in my experimentations I also added prettier as a code formatter

Just googled it and… opinionated code formatter. Love it : )

gvarandas commented 5 years ago

Just added a PR listing all the changes. If @caian-gums is preparing a PR, i could drop that.

cuducos commented 5 years ago

Closed by #13