配置文件

.eslintrc.js

module.exports={
	rules:{//配置某些规则的关闭
		'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
        'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
        'vue/no-parsing-error': [2, { 'x-invalid-end-tag': false }], // 解决eslint Parsing error: x-invalid-end-tag
        'no-console': 0,
        "no-unused-vars":"off"
	}
}

eslint忽略警告

alert('foo'); // eslint-disable-line

// eslint-disable-next-line
alert('foo');

/* eslint-disable-next-line */
alert('foo');

alert('foo'); /* eslint-disable-line */

eslint处理 定义未使用

"no-unused-vars":"off"

vue2 关闭eslint

在根目录新增 vue.config.js 文件

vue.config.js文件代码
module.exports = {
    lintOnSave: false
}