Blitz extends the default Next.js eslint config
This configuration is found in .eslintrc.js, and by default is
module.exports = {
extends: ["blitz"],
}
You can extend the base Blitz ESLint config, or replace it completely if you need.
There are a few things to remember:
In the below example:
module.exports = {
extends: ["blitz", "shared-config"],
rules: {
"additional-rule": "warn",
},
}
When ESLint is detected in your project, Blitz.js fails your production
build (blitz build
) when errors are present.
If you'd like Blitz.js to produce production code even when your application has ESLint errors, you can disable the built-in linting step completely.
Be sure you have configured ESLint to run in a separate part of your workflow (for example, in CI or a pre-commit hook). Open
blitz.config.js
and enable theignoreDuringBuilds
option in theeslint
config:
// blitz.config.js
module.exports = {
eslint: {
ignoreDuringBuilds: true,
},
}
A stricter next/core-web-vitals
rule set can also be added in
.eslintrc
:
{
"extends": ["blitz", "next/core-web-vitals"]
}
next/core-web-vitals
updates some rules from the base config to error on
a number of rules that are warnings by default if they affect
Core Web Vitals.