Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Don’t do it on Frontend or... Frontend good practices for devs

Posted on Oct 19 Delete.It's important to remove console.log in production Code to prevent sensitive information leaks and enhance performance.Investigate and fix.It's important to address console errors in production code to maintain a smooth and error-free user experiences.Do the correct typing.Using any in TypeScript should be minimized in favor of explicit types to enhance code reliability and maintainability.Delete.Commenting out unused code is bad practice as it clutters the code, hinders maintenance, and may lead to outdated comment information.If your component is large, the time has come to divide it into smaller components.Think about the good old principle of SOLID called Single Responsibility.For the love of Ada Lovelace, Alan Turing and Tim Berners Lee...Don't rewrite colors, fonts and sizes repeatedly, use design tokens to your advantage, create global CSS variables or use libs.Talk to your team about the advantages of using design tokens.Example: use /* eslint-disable @typescript-eslint/no-unused-vars */Fix your code. Don't send Pull Requests with linter errors or think carefully about what to ignore.Example: JavaScript loop functions or useEffect in React poorly applied.This may cause infinite repetition in API calls or values that can overflow memory and crash your application.Fix your logic.Do not place and do not allow.It is commonly agreed that any Frontend application cannot have business rules, only rules inherent to the user interface, for interaction and the user's successful journey.Frontend is the client, not the server.Make tests happen on your codebase. No code is perfect.Unit, Integration, Security, UX, Performance and Accessibility Tests. Use testing tools to generate error reports and improvements to correct your application.Example: Cypress, Lighthouse, SAST in the deploy pipeline, etc.Work in partnership with the UX, QA and Cybersecurity/Pentest teams if they exist on your company.You are a human.Please, whenever you are stuck, call another Dev or Technical Lead to share the problem you are facing.Problems are solved faster through pair programming and thinking together! Remember: They were once in your position and will help!I hope you enjoyed! 😃✌🏻Do you have any more TIPS?Support my work on Patreon.com/lucasmTemplates let you quickly answer FAQs or store snippets for re-use.The article is very well-written.However, I think there are some exceptions to the Flags to ignore Linter.For example, there are issues where ESLint errors are generated even though some function type declarations are not function implementations.Thanks for this contribution Yeom, you are right! Sometimes the Linters go on crazy mode haha Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Luqman Shaban - Oct 15 Salah Eddine Lalami - Oct 6 Andreas Bergström - Oct 15 MarkVachi (Vachirawit Laolod) - Oct 15 Once suspended, lucasm will not be able to comment or publish posts until their suspension is removed. Once unsuspended, lucasm will be able to comment and publish posts again. Once unpublished, all posts by lucasm will become hidden and only accessible to themselves. If lucasm is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to Lucas Menezes. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag lucasm: lucasm consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging lucasm will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Don’t do it on Frontend or... Frontend good practices for devs

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×