Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 1.12 KB

file-conventions.md

File metadata and controls

33 lines (21 loc) · 1.12 KB

File conventions

For consistency throughout the codebase, we will prioritize Named Imports over Default Imports

JS vs TS

Next.js is flexible about which files are TypeScript and which are JavaScript. We would like application files to be TypeScript where possible. Specify where those files are using "JavaScript XML":

.ts
.tsx

The majority of our tests are JavaScript and use .js extensions

Components

For modular component files, we will use a Direct File Naming approach.

We use Pascal Case for component names and any directories named after components:

  • Incorrect: orgMembersList
  • Correct: OrgMembersList

Any sub-components specific to a component are located in the same directory. Example of a component and subcomponent file:

/components/
     |-- OrgMembersList/
           |-- OrgMembersList.tsx
           |-- OrgMemberListItem.tsx