flipted-backend
  • Intruction
  • How To Guide
    • Getting Started
    • Use flipted CLI
  • Best Practice
    • Avoid using any type
    • Coding styles
  • Design
    • Data Schema
    • User Authentication
    • Mission - Learning Target Progress Class Diagram
  • API Documentation
    • Class Mission Mastery
    • Class Target Mastery
    • Courses
    • Goals
    • Missions
    • Objectives
    • Questions
    • Quiz Blocks
    • Class Roster
    • SubMissions
    • Targets
    • Tasks
    • Task Submissions
    • Users
    • User Progress
  • Support
    • Defect Reporting
Powered by GitBook
On this page

Was this helpful?

  1. Best Practice

Coding styles

PreviousAvoid using any typeNextData Schema

Last updated 4 years ago

Was this helpful?

  1. Always add a return type to a function definition.

    This is something that the compiler is able to figure out even we don't add a return type. However, by adding the return type, it's more human-readable.

  2. Remove unused import statements

  3. Remove unused variables, arguments.

  4. Always format code with prettier

  5. Catch error from async function

References

Getting Started - Linting your TypeScript Codebase
The future of TypeScript on ESLint