Skip to content

Linter

The project uses ESLint for linting the code. It uses ESlint β€œflat config”, and is based on the Antfu ESLint config.

Antfu rules are solid, supported by a strong community (and an excellent developer), and provides really good default for the technology we use.

This simplifies our configuration, removes a lot of headache, and prevents losing time over small linting details.

The linting is done automatically when you run pnpm lint. You can also run pnpm lint:fix to fix the linting errors automatically.

Flat config allows us to centralize all the rules in a single file, and to override them for specific files or directories.

For example, here is how we disable some rules for the API module:

export default antfu(
// Previous global rules...
// Only override rules for the API module
{
files: ['apps/api/**/*.ts', 'apps/api/**/*.json'],
rules: {
'ts/consistent-type-imports': 'off',
'node/prefer-global/process': ['error', 'always'],
},
}
)

Check out the Antfu ESLint config for more details on the rules and how to override them.