Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce linting with ESLint #14

Merged
merged 5 commits into from Nov 10, 2018

Conversation

Projects
None yet
3 participants
@SeanPrashad
Copy link
Contributor

commented Nov 9, 2018

Fixes #9: Introduce linting with ESLint

This PR introduces a number of tools that will help normalize our codebase, no matter whose authoring new or existing code.

It uses ESLint, a linter for JavaScript in combination with Prettier and Pretty-Quick. Prettier will automatically format code according to the rules specified in our .eslintrc. I've gone ahead and overridden some of Prettier's defaults (like using " instead of ' where applicable) within .prettierrc.

Pretty-Quick will format files on commit that differ from the respective version in the master branch. This means that if an author accidentally touches code without meaning to, it will format the files back to how it is on the master branch. In essence, this will minimize nits during PR reviews, meaning that we can focus more on 馃殺 ing great features for CC instead of worrying about semi-colons and new line characters 馃帀

@SeanPrashad

This comment has been minimized.

Copy link
Contributor Author

commented Nov 9, 2018

GIF of Pretty-Quick in action here!

@SeanPrashad SeanPrashad force-pushed the issue-9 branch from f5c86ca to e48635c Nov 9, 2018

SeanPrashad added some commits Nov 9, 2018

feat: Add linting with ESLint
ESLint is a tool that formats codebases, no matter whose behind the
keyboard. With Prettier and Pretty-Quick, any modified files that have
changed versus the master branch will be formatted accordingly. This
will ensure that any files accidentally touched are returned to their
former state, resulting in PR's that are less polluted.

Fixes #9

@SeanPrashad SeanPrashad force-pushed the issue-9 branch from e48635c to 3cddf26 Nov 9, 2018

Remove eslint dependency
As create-react-app uses its own version of eslint, we should not
explicitly install a higher version.
@klymenkoo
Copy link
Collaborator

left a comment

@SeanPrashad well done! The only change I would make: remove package-lock.json from the PR.
Other than that looks good to me 馃憤

@SeanPrashad SeanPrashad force-pushed the issue-9 branch from dac1384 to fb2f39b Nov 9, 2018

Add .prettierignore
This will prevent us from formatting folders like public and
node_module.

@SeanPrashad SeanPrashad force-pushed the issue-9 branch from fb2f39b to a0d8e17 Nov 9, 2018

@SeanPrashad

This comment has been minimized.

Copy link
Contributor Author

commented Nov 9, 2018

Thanks for the heads up @klymenkoo - removed it!

@Mera-Gangapersaud
Copy link
Owner

left a comment

Good work @SeanPrashad ! As you said this will help us focus more on shipping features rather than formatting.
Could you please add the prettier badge to the readme before we accept this PR?

Just add this snippet below the title:

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
@SeanPrashad

This comment has been minimized.

Copy link
Contributor Author

commented Nov 10, 2018

@Mera-Gangapersaud I've added the Prettier badge:

image

Previewing .md files in VSCode is done by hitting Ctrl K + V (hold down Ctrl for both keys)

@Mera-Gangapersaud

This comment has been minimized.

Copy link
Owner

commented Nov 10, 2018

Thanks 馃槃

@Mera-Gangapersaud Mera-Gangapersaud merged commit 7f6f0fa into master Nov 10, 2018

@SeanPrashad SeanPrashad deleted the issue-9 branch Nov 10, 2018

@Mera-Gangapersaud Mera-Gangapersaud referenced this pull request Nov 10, 2018

Merged

Added Travis CI #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.