-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix lint configuration #1219
Fix lint configuration #1219
Conversation
✅ Deploy Preview for veda-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
We may also want to add the rule |
Thanks for working on cleaning up our lint configuration! Our lint configuration had been accumulated over the years, and could use some clean-ups. (I have to confess that I have been putting the rules as I see the need, without thinking holistically.) But I am a bit confused
|
Thanks for your comment, @hanbyul-here ! ESLint and Prettier serve different purposes and can complement each other:
Typically, they are set up so that Prettier is integrated into the ESLint configuration using In our VSCode I believe we should agree on how to set up linting for this project. Here are three paths we can take: A) Keep everything as is and work around it locally—this means we might miss out on either Prettier or ESLint when using format on save. B) Enable Prettier to start throwing warnings and fix them as we go, following the principle of leaving the code we touch cleaner than we found it. C) Clean up the linting rules in this project to adopt a completely new style. We could simplify a lot by following the “recommended” rules, run fixes across the repository, review any remaining issues, and use those new rules moving forward. How do you all feel about these options? Which approach would you prefer? I’d love to hear your thoughts! |
I think I prefer this option, enabling prettier to throw warnings and progressively format only the files that we touch in our PRs, without reformatting the entire codebase, or running a full fix all. Also we will have a better overview of what we change in each PR and adapt some of the rules if needed.
Yeah I think this might be related to prettier’s formatting rules and how delimiters are handled |
Adding another thought: |
Thanks for going into details!
Yeah I think I will vote for B too. Regarding separating the lint rules - imo, veda-ui has been trying not to diverge the code as much as possible for the refactored parts of the code ex.Very often, refactored code is a container component that uses existing code. It would be ideal if the same rule goes to the lint rule (and it is a bit challenging to picture for me to separate them in a way that we can put them in separate folders but please let me know if there is something I am missing or you have a more concrete idea). Can we take a gradual approach such as, - first we make the prettier rule effecitve, without changing the current lint setup, then add the rules as we see the fits? |
daa49d7
to
d444f72
Compare
Ok, I will need to figure out how I can get the prettier formatting work on my end... I am not fully understanding the configuration we have in place, I think |
in .prettierrc. Also, added the typescript parser as override for .ts/.tsx files, which finally enabled me to correctly lint the typescript files.
d444f72
to
668ab66
Compare
Hi @hanbyul-here, @dzole0311 and others, I think I found the solution we want. I enabled prettier for typescript files with a warning. Also, I specified the parser to be "typescript" for those files, which finally enabled me to use format on save as I expect it to behave. Could you please check out those changes and test the behavior in your code editor? Especially indentation was a frustrating issue for me. I believe it should now work. Note: I force-pushed the branch to keep the git history clean from my failed attempts :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the changes locally and it works much better from what I had before in terms of indentation. Thanks @AliceR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on it!!! 🙇
## 🎉 Features * Card image/description independent of hero image/description by @dzole0311 in #1244 ## 🚀 Improvements * Cookie consent code cleanup by @snmln in #1199 , and @hanbyul-here in #1240 , and @hanbyul-here in #1241 * Add ADR about design system change by @j08lue in #890 * Update condition to run playwright tests on release branches by @dzole0311 in #1228 * Update STYLE_GUIDE.md by @AliceR in #1227 * Fix lint configuration by @AliceR in #1219 * Add tests for the AOI feature specification by @AliceR in #1216 * Set data catalog filters to be closed by default by @vgeorge in #1243 * Update tsconfig and make nav interfaces exposable for consumption by @sandrahoang686 in #1223 ## 🐛 Fixes * Hotfix to hide the external link badge from cards by @dzole0311 in #1231 ## New Contributors * @vgeorge made their first contribution in #1243 **Full Changelog**: v5.9.0...v5.10.0
Related Ticket: {link related ticket here}
Description of Changes
My local dev setup / code editor setup wasn't working with
format on save
and the specified rules in.vscode/settings.json.sample
. I noticed that we have the prettier rules disabled for all .ts/.tsx files in our .eslint configuration.Additionally, we have the prettier rules specified in both the .prettierrc and the .eslintrc, which is redundant and confusing.
I enabled the prettier rules for .ts/.tsx files and removed the redundancy. After that, I ran
yarn lint:scripts --fix
to automatically fix the lint issues across the codebase, now that we have the rules enabled. Unfortunately, it turns out that this will give a few more issues that needs attention.Before going deeper into fixing these, I want to ask the team:
Notes & Questions About Changes
Opened a draft for team discussion
Validation / Testing
See if you can use formatOnSave to automatically correct the line indentation in your cloned codebase. Run
yarn lint
and check for errors.