测试Eslint
This commit is contained in:
parent
c6ecc56060
commit
6983450d59
|
|
@ -0,0 +1,8 @@
|
||||||
|
node_modules/
|
||||||
|
uni_modules/
|
||||||
|
unpackage/
|
||||||
|
dist/
|
||||||
|
*.min.js
|
||||||
|
*.css
|
||||||
|
*.scss
|
||||||
|
*.json
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -488,7 +488,7 @@ onBackPress((e) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
onLoad(async (option) => {
|
onLoad(async () => {
|
||||||
if (option.source) {
|
if (option.source) {
|
||||||
data.source = option.source
|
data.source = option.source
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue