Next.js Discord

Discord Forum

ESLint ignored during build to save memory?

Unanswered
West African Lion posted this in #help-forum
Open in Discord
West African LionOP
Hey.
I have hit the deploy build limit for the fist time (SIGKILL because OOM).
I've read that
eslint: {
    ignoreDuringBuilds: true,
  },

Could be one of the many ways to help with the issue, but has anyone already tested this?
I have a yarn lint command in my pre-commit so this should be fine, but I would just be sure that it's not a pointless rule to add, because saving space/RAM is the only thing I'd be using it for.

For information, I'm good in Disk, but 98%+ in memory p99

5 Replies

West African LionOP
From local tests it doesn't seem to change the build time so idk
@West African Lion Hey. I have hit the deploy build limit for the fist time (SIGKILL because OOM). I've read that js eslint: { ignoreDuringBuilds: true, }, Could be one of the many ways to help with the issue, but has anyone already tested this? I have a `yarn lint` command in my pre-commit so this should be fine, but I would just be sure that it's not a pointless rule to add, because saving space/RAM is the only thing I'd be using it for. For information, I'm good in Disk, but 98%+ in memory p99
Rottweiler
Yes, adding eslint: { ignoreDuringBuilds: true } in your next.config.js can help reduce memory usage during builds since it skips the eslint step.
Since you already run yarn lint in pre-commit, it’s safe and won’t affect code quality checks. It’s a valid optimization for low-memory build environments.
West African LionOP
Thanks, just added it!
@alfonsüs ardani does it work?
West African LionOP
My next builds haven't failed, even though it doesn't seem to make a big difference. Not sure if my failed build was just unlucky, or if the effect is really good enough