Skip to content
Ken Jiang edited this page Aug 23, 2023 · 1 revision

Style

Linting and Code Style

This repo uses Prettier and ESLint to enforce styling and lining rules.

This repo uses Four Spaces as indentation, and CRLF line endings.

Pages

As little styling and javascript as possible should be located in the page/ files. In a perfect world, those files will only include:

  • Imports
  • Constants
  • Next.js functions (getStaticProps, etc.)
  • Components

Most styling and functionality should be delegated to the components themselves.

Content

Currently, we do not use a CMS. This means that, unfortunately, all page content (text, images) must be hardcoded into the repo. Create a const at the top of the page for a section of text, and pass that constant into the component. See the careers.tsx page for an example.

Colors

Try to use the colors prefixed with wato- located in tailwind.config.js as much as possible. Black and white will use the default tailwind colors.

Components

Components should be reused as much as possible. Forms, buttons, cards, etc. may already be created to be used in the components/ folder.

Typescript

Interfaces used only one one component should be placed at the top of their respective file below imports. If an interface is used across multiple components, place them in the types.ts file, located in the root directory.

Clone this wiki locally