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

Improve linter #166

Merged
merged 12 commits into from
Oct 31, 2023
Merged

Improve linter #166

merged 12 commits into from
Oct 31, 2023

Conversation

giladfuchs
Copy link
Collaborator

Description

this to resolve #160 issue
clean all unused code with ts-prune

and remove unused export.

add ci in lint check for circular dependencies

add for linter not allowed unused code like
"@typescript-eslint/no-unused-vars": "error",
that was mostly react import so I also add this
"react/react-in-jsx-scope": "off",

@giladfuchs giladfuchs requested a review from NoamGaash as a code owner October 31, 2023 10:01
@netlify
Copy link

netlify bot commented Oct 31, 2023

Deploy Preview for astonishing-pothos-5f81bd ready!

Name Link
🔨 Latest commit 9c18974
🔍 Latest deploy log https://app.netlify.com/sites/astonishing-pothos-5f81bd/deploys/654123a82c49310008f3b77b
😎 Deploy Preview https://deploy-preview-166--astonishing-pothos-5f81bd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@giladfuchs
Copy link
Collaborator Author

giladfuchs commented Oct 31, 2023

after falling
yarn build

since there is unused import in node modules
I put it back to normal that allow unused import
for passing the test.

anyway the project clean from unused export/import

if you want to put back in linter you should change
at
.eslintrc.json
"@typescript-eslint/no-unused-vars": "error",

and at
tsconfig.json "noUnusedLocals": true,

.eslintrc.json Outdated
Comment on lines 26 to 27
"@typescript-eslint/no-unused-vars": "off",
"react/react-in-jsx-scope": "off",
Copy link
Member

Choose a reason for hiding this comment

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

please find a solution so we'll get errors / warning whenever we have unused variable

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed to "error"

tsconfig.json Outdated
@@ -9,6 +9,7 @@
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": true,
"noUnusedLocals": false,
Copy link
Member

Choose a reason for hiding this comment

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

why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

when you change it to true it raise an error on unused variables

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok so i remove it.
stay only with linter.
then node modules not make a problem

"plugins": ["react", "@typescript-eslint"],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "error",
"react/react-in-jsx-scope": "off",
Copy link
Member

Choose a reason for hiding this comment

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

is it needed?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@NoamGaash NoamGaash left a comment

Choose a reason for hiding this comment

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

thanks! that's so great

@giladfuchs giladfuchs merged commit c2f4abd into main Oct 31, 2023
9 checks passed
@NoamGaash NoamGaash deleted the improve-linter branch November 1, 2023 07:05
@giladfuchs giladfuchs mentioned this pull request Nov 13, 2023
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.

Add lint rules
2 participants