提交 a67ee6a4 authored 作者: 王鹏飞's avatar 王鹏飞

add eslint

上级 31ac5338
module.exports = {
env: {
node: true
},
extends: ['eslint:recommended', 'plugin:vue/essential'],
rules: {
'vue/comment-directive': 'off'
// "prettier/prettier": "error"
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
}
}
差异被折叠。
......@@ -7,7 +7,8 @@
"build:pre": "vite build",
"build:test": "vite build --mode test",
"preview": "vite preview",
"deploy": "node ./deploy/oss.js"
"deploy": "node ./deploy/oss.js",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src"
},
"dependencies": {
"axios": "^0.21.1",
......@@ -21,12 +22,15 @@
"vuex": "^3.6.2"
},
"devDependencies": {
"@rollup/plugin-eslint": "^8.0.1",
"ali-oss": "^6.16.0",
"chalk": "^4.1.2",
"cross-env": "^7.0.3",
"sass": "^1.37.5",
"vite": "^2.4.4",
"vite-plugin-vue2": "^1.8.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^7.16.0",
"sass": "^1.38.0",
"vite": "^2.5.0",
"vite-plugin-vue2": "^1.8.1",
"vue-template-compiler": "^2.6.14"
}
}
; (function (win, doc) {
(function (win, doc) {
var resize = 'orientationchange' in window ? 'orientationchange' : 'resize'
/* 使用rem 动态计算跟font-size值 */
function resizeRoot() {
......
import store from '@/store'
const UA = navigator.userAgent
const isMobile = /iphone/i.test(UA) || (/android/i.test(UA) && /mobile/i.test(UA))
const isIe = window.ActiveXObject || 'ActiveXObject' in window
const isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime)
// let chromeVersion = 0
// if (isChrome) {
// const temp = UA.match(/Chrome\/([\d.]+)/)
// chromeVersion = temp ? parseFloat(temp[1]) : 0
// }
// const notSupport = !isMobile && (isIe || (isChrome && chromeVersion < 70))
const notSupport = !isMobile && isIe
// https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
export default async function (to, from, next) {
// 浏览器不支持
if (notSupport && to.name !== 'browser') {
next({ path: '/browser' })
return
}
// 登录白名单
const whiteList = []
if (whiteList.includes(to.path)) {
......
......@@ -2,10 +2,11 @@ import fs from 'fs'
import path from 'path'
import { defineConfig } from 'vite'
import { createVuePlugin } from 'vite-plugin-vue2'
import eslint from '@rollup/plugin-eslint'
export default defineConfig({
base: process.env.BUILD_ENV === 'prod' ? 'https://webapp-pub.ezijing.com/website/prod/marketing-admin/' : '/',
plugins: [createVuePlugin()],
plugins: [eslint({ include: '**/*.+(vue|js|jsx|ts|tsx)' }), createVuePlugin()],
server: {
open: true,
host: 'dev.ezijing.com',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论