Skip to content

Latest commit

 

History

History
79 lines (53 loc) · 1.03 KB

import-priority.md

File metadata and controls

79 lines (53 loc) · 1.03 KB

Import Priority

This is not a very important rule but complying with it is not gonna have harm either.

The priority is like below:

  1. Imports from React except for types. e.g. hooks and ...
import { useState } from "react";
  1. Kits
import Text from "@kits/Text";
  1. Components
import AnyComponent from "@components/AnyComponent";
  1. Contexts
import LayoutProvider from "@contexts/Layout/Provider";
  1. Hooks
import useToggle from "@hooks/useToggle";
  1. Utils
import Http from "@utils/Http";
  1. Helpers
import LayoutHelper from "@helpers/layout";
  1. Services
import AuthServices from "@services/auth";
  1. Configs
import { appBaseURL } from "@configs/utl";
  1. Constants
import { TOKEN_COOKIE_KEY } from "@constants/cookies";
  1. Static Files
import appLogo from "@images";
import "path/to/a/css/file.css";
  1. Types
import type { FC, PropsWithChildren } from "react";
import type DivProps from "@kits/Div/props";