Skip to content

Conversation

@orama254
Copy link
Member

@orama254 orama254 commented Aug 4, 2022

Fixes Issue

configure eslint and prettier for project wide code uniformity

Changes proposed

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation. (an extra step to run lint and prettier before commits)
  • I have updated the documentation accordingly. (Will do after this PR)
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Note to reviewers

@vercel
Copy link

vercel bot commented Aug 4, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
reactdevske-website ✅ Ready (Inspect) Visit Preview Aug 4, 2022 at 5:37PM (UTC)

Copy link
Member

@antosan antosan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job @orama254 🎉 I have some comments:

  1. We should remove the .eslintrc.json line from the .gitignore so that git can track the .eslintrc.json file. After removing it, run npm run lint, choose strict and include the generated .eslintrc.json file in the committed files.

    Also, eslint rules usually conflict with prettier rules and in order to prevent this:

    • Run npm install --save-dev eslint-config-prettier
    • Update .eslintrc.json to:
    {
    	"extends": ["next/core-web-vitals", "prettier"]
    }
  2. Whenever I open a .jsx file that does not include import React from 'react'; in VSCode, e.g. src/pages/index.page.jsx, I get a lot of warnings. Do you have the same?

image

@orama254
Copy link
Member Author

orama254 commented Aug 4, 2022

Nice job @orama254 🎉 I have some comments:

  1. We should remove the .eslintrc.json line from the .gitignore so that git can track the .eslintrc.json file. After removing it, run npm run lint, choose strict and include the generated .eslintrc.json file in the committed files.
    Also, eslint rules usually conflict with prettier rules and in order to prevent this:

    • Run npm install --save-dev eslint-config-prettier
    • Update .eslintrc.json to:
    {
    	"extends": ["next/core-web-vitals", "prettier"]
    }
  2. Whenever I open a .jsx file that does not include import React from 'react'; in VSCode, e.g. src/pages/index.page.jsx, I get a lot of warnings. Do you have the same?

image

@antosan for the second point there is a line on the lint config that should disable this. Could you try it out now that the file isn't ignored inside git.

    {
  	  "globals": {
               "React": "readonly"
           },
    }

@antosan
Copy link
Member

antosan commented Aug 5, 2022

@antosan for the second point there is a line on the lint config that should disable this. Could you try it out now that the file isn't ignored inside git.

This didn't fix it for me, probably it is just my editor misbehaving.

Copy link
Member

@antosan antosan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@orama254 orama254 merged commit 21651ec into reactdeveloperske:develop Aug 19, 2022
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.

2 participants