Skip to content

Commit

Permalink
fix: eslint修复格式化问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wlxuqu committed Nov 15, 2021
1 parent 55d8d79 commit 899c313
Show file tree
Hide file tree
Showing 252 changed files with 12,337 additions and 12,397 deletions.
7 changes: 4 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
unpackage
node_modules
uview-ui
unpackage
node_modules
coverage
static/common/*
26 changes: 26 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
extends: ['eslint-config-egg', 'airbnb'],
rules: {
// 关闭严格模式的提示
strict: 0,
// 强制4个空格缩进
indent: ['error', 4],
// 不允许出现分号
semi: ['error', 'never'],
// 是否检查连续等号赋值
'no-multi-assign': 0,
// 要求 require() 出现在顶层模块作用域中,禁止它
'global-require': 0,
// 允许console,覆盖来自airbnb的规则
'no-console': 'off',
'no-underscore-dangle': 'off',
'prefer-rest-params': 'off',
// 禁用对象最后一个属性的逗号
'comma-dangle': ['error', 'never'],
// 可以使用未定义的变量,因为会全局引用uni对象
'no-undef': 'off',
// 允许lf和crlf文件行尾
'linebreak-style': 'off',
'jsdoc/check-tag-names': 'off'
}
}
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"grasspy.autopunc"
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// 是否在保存文件时自动修复,与运行命令行的--fix意思相同
"eslint.codeActionsOnSave.mode": "all",
// 是否对本项目启用eslint
"eslint.enable": false,
// 统一所有文件均为lf
// "files.eol": "\n",
// 展示总的todo数量
"todo-tree.tree.showCountsInTree": true
}
2 changes: 1 addition & 1 deletion common/api.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const http = uni.$u.http
const { http } = uni.$u
// 获取菜单
export const fetchMenu = (params, config = {}) => http.post('/ebapi/public_api/index', params, config)
4 changes: 2 additions & 2 deletions common/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
baseUrl: 'https://api.youzixy.com'
}
baseUrl: 'https://api.youzixy.com'
}
12 changes: 6 additions & 6 deletions common/mixin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
data(){
return {
}
}
}
data() {
return {

}
}
}
28 changes: 15 additions & 13 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,33 @@ import App from './App'

// vuex
import store from './store'

// 引入全局uView
import uView from '@/uni_modules/uview-v2'
// #endif

import mixin from './common/mixin'

Vue.prototype.$store = store

Vue.config.productionTip = false

App.mpType = 'app'
Vue.use(uView)

// 引入全局uView
import uView from '@/uni_modules/uview-v2'
Vue.use(uView)

// #ifdef MP
// #ifdef MP
// 引入uView对小程序分享的mixin封装
let mpShare = require('@/uni_modules/uview-v2/libs/mixin/mpShare.js');
Vue.mixin(mpShare);
// #endif
const mpShare = require('@/uni_modules/uview-v2/libs/mixin/mpShare.js')

import mixin from './common/mixin'
Vue.mixin(mpShare)
Vue.mixin(mixin)

const app = new Vue({
store,
...App
})
store,
...App
})

// 引入请求封装
require('./util/request/index')(app)

app.$mount()
app.$mount()
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scripts": {
"test": "eslint . --fix"
},
"dependencies": {
"eslint-config-airbnb": "^19.0.0"
},
"devDependencies": {
"eslint": "^8.2.0",
"eslint-config-egg": "^9.0.0"
}
}
Loading

0 comments on commit 899c313

Please sign in to comment.