# 忽略 ESLint

当ESLint在你的项目中被检测到时,next .js会在错误出现时使你的生产构建(' next build ')失败。

如果你想让Next.js即使在你的应用程序有ESLint错误时也能产生产品代码,你可以完全禁用内置的检测步骤。不建议这样做,除非你已经将ESLint配置为在工作流的单独部分运行(例如,在CI或预提交钩子中)。

Open next.config.jsand enable the ignoreDuringBuildsoption in the eslintconfig:

module.exports = {
  eslint: {
    // Warning: This allows production builds to successfully complete even if
    // your project has ESLint errors.
    ignoreDuringBuilds: true,
  },
}

Introduction to next.config.jsLearn more about the configuration file used by Next.js. ESLintGet started with ESLint in Next.js.

Last Updated: 5/13/2023, 8:55:38 PM