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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci/Setup Linting #16

Merged
merged 6 commits into from
Aug 14, 2020
Merged

Ci/Setup Linting #16

merged 6 commits into from
Aug 14, 2020

Conversation

AlexKMarshall
Copy link
Collaborator

@AlexKMarshall AlexKMarshall commented Aug 14, 2020

This sets up linting on the React side. Mainly following information from https://www.robertcooper.me/using-eslint-and-prettier-in-a-typescript-project and facebook/create-react-app#8849

Add the following to your VSCode settings.json file to automatically apply linter fixes when you save files

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
}

Note that the .env file for the client side is committed to the repo as described at https://create-react-app.dev/docs/adding-custom-environment-variables/

Secret variables must not be added to this file, as they will be visible in the final build of the client.

This PR also adds a pre-commit hook to run the linter. It will fix automatically any files it can, but anything that it can't fix automatically will cause the commit to fail until you fix them manually.

Additionally, I had to set up lint-staged differently because of running two separate packages, client and server. I followed instructions at https://github.com/sudo-suhas/lint-staged-multi-pkg

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2020

Codecov Report

Merging #16 into master will increase coverage by 47.72%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #16       +/-   ##
===========================================
+ Coverage    2.27%   50.00%   +47.72%     
===========================================
  Files           3        2        -1     
  Lines          44        2       -42     
  Branches       12        0       -12     
===========================================
  Hits            1        1               
+ Misses         43        1       -42     
Impacted Files Coverage Δ
client/src/App.tsx 100.00% <ø> (ø)
client/src/index.tsx 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9833de4...1ef0fd9. Read the comment docs.

@AlexKMarshall AlexKMarshall mentioned this pull request Aug 14, 2020
@hucki hucki merged commit 2093790 into master Aug 14, 2020
@hucki hucki deleted the ci/lerna branch August 14, 2020 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants