42 lines
1009 B
JavaScript
42 lines
1009 B
JavaScript
module.exports = {
|
|
root: true,
|
|
env: {
|
|
browser: true,
|
|
es2021: true,
|
|
node: true,
|
|
'vue/setup-compiler-macros': true
|
|
},
|
|
extends: [
|
|
'eslint:recommended',
|
|
'plugin:vue/vue3-essential'
|
|
],
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module'
|
|
},
|
|
plugins: [
|
|
'vue'
|
|
],
|
|
// 核心拦截规则
|
|
rules: {
|
|
'no-undef': 'error', // 静态拦截致命错误:防止引用不存在的参数(造成崩溃的主因)
|
|
'no-unused-vars': 'warn', // 变量未使用仅作黄牌警告,降低大盘爆红率
|
|
'vue/multi-word-component-names': 'off', // 兼容历史单字组件命名
|
|
'no-empty': 'warn',
|
|
'no-constant-condition': 'warn'
|
|
},
|
|
globals: {
|
|
uni: 'readonly',
|
|
plus: 'readonly',
|
|
wx: 'readonly',
|
|
getApp: 'readonly',
|
|
getCurrentPages: 'readonly',
|
|
setTimeout: 'readonly',
|
|
clearTimeout: 'readonly',
|
|
setInterval: 'readonly',
|
|
clearInterval: 'readonly',
|
|
console: 'readonly',
|
|
__dirname: 'readonly'
|
|
}
|
|
}
|