chore(eslint): 使用babel-eslint解析

This commit is contained in:
zyn
2023-12-15 11:56:48 +08:00
parent 221e68134b
commit 91d25f107f
3 changed files with 12 additions and 8 deletions
+1
View File
@@ -4,6 +4,7 @@ module.exports = {
'extends': ['eslint:recommended', 'plugin:vue/recommended'],
// 解析选项
'parserOptions': {
parser: "babel-eslint", // 解析器
'ecmaVersion': 6, // ES 语法版本
'sourceType': 'module', // ES 模块化
'ecmaFeatures': { // ES 其他特性
+1
View File
@@ -48,6 +48,7 @@
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.3",
"eslint": "6.7.2",
"eslint-plugin-vue": "6.2.2",
+10 -8
View File
@@ -1,6 +1,6 @@
import '@babel/polyfill'
require('es6-promise').polyfill();
require('es6-promise/auto');
require('es6-promise').polyfill()
require('es6-promise/auto')
import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui'
@@ -34,13 +34,13 @@ import VueI18n from 'vue-i18n' // 国际化
import { simpleUploadPath } from '@/sysConfig'
// 时间转换
import moment from 'moment'
moment.suppressDeprecationWarnings = true;
moment.suppressDeprecationWarnings = true
// 右键菜单
import Contextmenu from 'vue-contextmenujs'
// vant
import vant from 'vant';
import 'vant/lib/index.css';
import vant from 'vant'
import 'vant/lib/index.css'
//vant
import animate from 'animate.css'
@@ -53,7 +53,7 @@ import { webLoginType } from '@/sysConfig'
import VConsole from 'vuex'
import isMobile from './store/isMobile';
import isMobile from './store/isMobile'
import { getCode, toIdmLoginPage, loginInIdm, loginInPhone, close } from '@/utils/login'
router.beforeEach((to, from, next) => {
@@ -66,7 +66,8 @@ router.beforeEach((to, from, next) => {
path = '/phone' + path
next({ path: path })
}
if (!to.name) { // 不存在路由
if (!to.name) {
// 不存在路由
next('/blankPage')
}
}
@@ -83,7 +84,8 @@ router.beforeEach((to, from, next) => {
next()
} else {
if (to.path === '/login') {
if (webLoginType === 'idm') { // webLoginType === "idm"时不会进入login路由
if (webLoginType === 'idm') {
// webLoginType === "idm"时不会进入login路由
// let href = window.location.href.replace('code=' + getCode(), '')
// toIdmLoginPage(href)
}