rsnext/contributing/repository/linting.md
Balázs Orbán 3ff21ed178
refactor: split up CONTRIBUTING.md (#40515)
Continues #39778

Closes #40499

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-16 14:54:58 -07:00

1.1 KiB

Linting

The Next.js repository runs ESLint, Prettier and alex to lint and format all code and documentation.

To lint all code you can run:

pnpm lint

If you get errors, you can run the ESLint and Prettier auto-fix using:

pnpm lint-fix

Not all rules can be auto-fixed, those require manual changes.

If you get a warning by alex, follow the instructions to correct the language.

ESLint

We recommend installing the ESLint plugin for VS Code.

You can find the enabled rules in the ESLint config.

Prettier

We recommend installing the Prettier plugin for VS Code.

You can find the format configuration in the Prettier config.

alex

We recommend installing the AlexJS Linter extension for VSCode

You can find the configuration in the alex config.