- Does the code work?
- Description of the project status is included.
- Code is easily understand.
- Code is written following the coding standarts/guidelines (React in our case).
- Code is in sync with existing code patterns/technologies.
- DRY. Is the same code duplicated more than twice?
- Can the code be easily tested (don't forget about React components)?
- Are functions/classes/components reasonably small (not too big)?
- Event listeners removed at teardown.
- Naming conventions followed for variables, file names, translations.
- Removed unused packages from NPM.
- Separation of Concerns followed.
- avoid console usage, replace it by another logger lib
- avoid long files, more than 400-500 lines are hard to support
- build on the shoulders of giants (use well tested libraries instead of developing own)
- avoid multiple returns in code (but be ok with a quick input params checks and quick return)
- avoid nesting/scopes (more than 3 levels is usually problematic)
- No hardcoded values, use constants values.
- Avoid multiple if/else blocks.
- No commented out code.
- No unnecessary comments: comments that describe the how.
- Add necessary comments where needed. Necessary comments are comments that describe the why.
- Use ES6 features.
- Use fat arrow instead of var that = this. Be consistent in your usage of arrow function.
- Use spread/rest operator.
- Use default values.
- Use const over let (avoid var).
- Use import and export.
- Use template literals.
- Use destructuring assignment for arrays and objects.
- Use Promises or Asyns/Await. Rejection is handled.
- Are components have defined propTypes?
- Keep components small.
- Functional components for components that don't use state.
- No api calls in containers, delegate to Sagas
- No state updates in loop.
- No useless constructor.
- Minimize logic in the render method.
- Don’t use mixins, prefer HOC and composition.
- prefer arrow functions (es2015 syntax)
- avoid
this.
usage
- Use lodash/ramda functions instead of implementing itself.
- Is Immutable.js was used correctly?
- Is any nice/useful library was used wich we didn't know before?
- Code has no any linter errors or warnings.
- No console.logs.
- Consistent naming conventions are used (BEM, OOCSS, SMACSS, e.t.c.).
- CSS selectors are only as specific as they need to be; grouped logically.
- Is any 'CSS in JS' library was used?
- Use Hex color codes #000 unless using rgba().
- Avoid absolute positioning.
- Use flexbox.
- Avoid !important.
- Do not animate width, height, top, left and others. Use transform instead.
- Use same units for all project.
- Avoid inline styles.
- Use clsx lib (or alternative) for composing styles
- Document and test layout parent/container to child dependency (flex, grid, width, heights, etc)
- Try to structure styles by categories:
- Layout responsive rules/media queries,
- visual styles, typography, colors, fonts, text size
- background images, background color
- animation
- separate code from styles
- do not mix different CSS styles libs (MUI, tailwind, bootstrap, etc)
- Tests are readable, maintainable, trustworthy.
- Test names (describe, it) are concise, explicit, descriptive.
- Avoid logic in your tests.
- Don't test multiple concerns in the same test.
- Cover the general case and the edge cases.
- Test the behaviour, not the internal implementation. Is test agnostic to component code changes?
- Use a mock to simulate/stub complex class structure, methods or async functions.
- Possitive and Negative tests available
- Code coverage is higher 85%
- Module isolated during test from external dependencies (avoid child components/libs testing)
- Avoid "magic numbers" in tests (index of parameter, index of mock calls history, etc.)
- Commits are small and divided into logical parts.
- Commits messages are small and understandable.
- Use branches for new features.
- Make sure no dist files, editor/IDE files, etc are checked in. There should be a .gitignore for that.
- Security.
- Usability.
- Code Review Checklist – To Perform Effective Code Reviews
- Code review checklist
- React code review checklist
- Checklist for reviewing your own React code
- Front-end Code Review & Validation Tools
- A guide to unit testing in JavaScript
- Unit Testing Checklist: Keep Your Tests Useful and Avoid Big Mistakes
- Java Script Best Practices
- W3 Best Practices
===
Js Best Practices from Opera Dev - 5 Differences Between Arrow and Regular Functions
- ES.NEXT Finished Proposals
- ES.NEXT
- Common Mistakes
- Performacne Hints
- 24 Js Best Practices for Beginners
- babeljs.io
Books - https://blog.devgenius.io/top-12-javascript-books-to-read-in-2022-282dc630e0dc