Linting & Formatting

Overview

Linting and formatting work out of the box in this starter kit. You simply have to edit the configuration files according to your needs, and you're done!

Tech used

  • ESLint: For linting and enforcing rules.

  • Prettier: For formatting the code.

  • Lint Staged: To check linting and format staged files.

  • Husky: Pre-commit hooks to run linting and formatting before every commit.

How to customize

Linting

All the contents/rules of linting are in the .prettierrc.json file. You can edit that file to add, remove or update any styles.

You can find all the rules you can configure here: https://eslint.org/docs/latest/rules/

Formatting

All the contents/rules of linting are in the .eslintrc.json file. You can edit that file to add, remove or update any styles.

You can find all the rules you can configure here: https://prettier.io/docs/en/options

After changing any of the above file, you should make sure all the files in your project follow those rules.

  • After making change in linting rules, run bunx eslint --fix .

  • After making changes in formatting rules, run bunx prettier --write .

Other resources

Last updated