47 lines
943 B
JavaScript
47 lines
943 B
JavaScript
module.exports = {
|
|
env: {
|
|
browser: true,
|
|
es2021: true,
|
|
node: true
|
|
},
|
|
extends: [
|
|
'eslint:recommended'
|
|
],
|
|
parserOptions: {
|
|
ecmaVersion: 12,
|
|
sourceType: 'module'
|
|
},
|
|
globals: {
|
|
// 微信小程序全局变量
|
|
App: 'readonly',
|
|
Page: 'readonly',
|
|
Component: 'readonly',
|
|
Behavior: 'readonly',
|
|
wx: 'readonly',
|
|
getApp: 'readonly',
|
|
getCurrentPages: 'readonly',
|
|
|
|
// 支付宝小程序全局变量
|
|
my: 'readonly',
|
|
|
|
// 百度小程序全局变量
|
|
swan: 'readonly',
|
|
|
|
// 字节跳动小程序全局变量
|
|
tt: 'readonly',
|
|
|
|
// QQ小程序全局变量
|
|
qq: 'readonly',
|
|
|
|
// 通用小程序全局变量
|
|
uni: 'readonly'
|
|
},
|
|
rules: {
|
|
'indent': ['error', 2],
|
|
'linebreak-style': ['error', 'unix'],
|
|
'quotes': ['error', 'single'],
|
|
'semi': ['error', 'never'],
|
|
'no-unused-vars': ['warn'],
|
|
'no-console': ['warn']
|
|
}
|
|
} |