Nuxt 项目中如何关闭 ESLint 检测
要关闭ESLint检测,你可以在nuxt.config.js文件中添加以下配置:\n\njavascript\nmodule.exports = {\n // ...\n build: {\n // ...\n extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n // ...\n config.module.rules.push({\n enforce: 'pre',\n test: /.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true,\n emitWarning: false // 关闭eslint警告\n }\n })\n }\n }\n }\n}\n\n\n在上面的代码中,我们通过设置emitWarning: false关闭了ESLint的警告。你可以根据需要设置其他的ESLint相关选项。
原文地址: https://www.cveoy.top/t/topic/pmH3 著作权归作者所有。请勿转载和采集!