Commit 144f7d03 authored by lipengcheng 's avatar lipengcheng

lint

parent 514d78e6
This diff is collapsed.
module.exports = { module.exports = {
// 不使用prettier格式化的文件填写在项目的.prettierignore文件中
ignorePath: ".prettierignore",
// 与eslint集成(让prettier使用eslint的代码格式进行校验) // 与eslint集成(让prettier使用eslint的代码格式进行校验)
eslintIntegration: true, eslintIntegration: true,
// 换行长度 // 换行长度
...@@ -7,10 +9,10 @@ module.exports = { ...@@ -7,10 +9,10 @@ module.exports = {
tabWidth: 4, tabWidth: 4,
// 使用tab缩进,默认false // 使用tab缩进,默认false
useTabs: false, useTabs: false,
// 使用分号, 默认true // 是否使用分号, 默认true
semi: false, semi: false,
// 使用单引号, 默认false(在jsx中配置无效, 默认都是双引号) // 是否使用单引号, 默认false(在jsx中配置无效, 默认都是双引号)
singleQuote: true, singleQuote: false,
// 行尾逗号,默认none,可选 none|es5|all // 行尾逗号,默认none,可选 none|es5|all
// es5 包括es5中的数组、对象 // es5 包括es5中的数组、对象
// all 包括函数对象等所有可选 // all 包括函数对象等所有可选
...@@ -32,5 +34,10 @@ module.exports = { ...@@ -32,5 +34,10 @@ module.exports = {
// avoid 能省略括号的时候就省略 例如x => x // avoid 能省略括号的时候就省略 例如x => x
// always 总是有括号 // always 总是有括号
arrowParens: 'always', arrowParens: 'always',
endOfline: "auto" // 结尾是 \n \r \n\r auto
endOfline: "auto",
// 在jsx中把'>' 是否单独放一行
jsxBracketSameLine: false,
} }
module.exports = { module.exports = {
presets: ['@vue/cli-plugin-babel/preset'] presets: ["@vue/cli-plugin-babel/preset"]
} }
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0", "@vue/cli-plugin-babel": "^4.5.0",
"@vue/cli-plugin-eslint": "^4.5.0", "@vue/cli-plugin-eslint": "^4.5.4",
"@vue/cli-plugin-pwa": "^4.5.0", "@vue/cli-plugin-pwa": "^4.5.0",
"@vue/cli-service": "^4.5.0", "@vue/cli-service": "^4.5.0",
"@vue/eslint-config-prettier": "^6.0.0", "@vue/eslint-config-prettier": "^6.0.0",
...@@ -52,13 +52,14 @@ ...@@ -52,13 +52,14 @@
"commitizen": "^4.2.0", "commitizen": "^4.2.0",
"cz-conventional-changelog": "^3.2.1", "cz-conventional-changelog": "^3.2.1",
"element-ui": "^2.13.2", "element-ui": "^2.13.2",
"eslint": "^6.7.2", "eslint": "^6.8.0",
"eslint-plugin-prettier": "^3.1.3", "eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^6.2.2",
"husky": "^3.1.0", "husky": "^3.1.0",
"lint-staged": "^10.2.11", "lint-staged": "^10.2.11",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"prettier-eslint": "^11.0.0",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"serve": "^11.3.2", "serve": "^11.3.2",
"standard-version": "^9.0.0", "standard-version": "^9.0.0",
......
...@@ -5,25 +5,30 @@ ...@@ -5,25 +5,30 @@
<side-nav></side-nav> <side-nav></side-nav>
<router-view style="flex:1;border: 1px solid #666;"></router-view> <router-view style="flex:1;border: 1px solid #666;"></router-view>
<right-panel></right-panel> <right-panel></right-panel>
<!-- <video
src="baidsfsfsdfsdfsdfsdfsdfsdfsfsdfsfsfsefsfsfsdfsdfdsfsdfu.com/mp4"
a="afasfsafdfasdfsfad"></video>
<input id="" type="text"
name=""/> -->
</body> </body>
</div> </div>
</template> </template>
<script> <script>
import CommonHeader from '@/components/header/index.vue' import CommonHeader from "@/components/header/index.vue"
export default { export default {
components: { components: {
CommonHeader, CommonHeader,
SideNav: () => import('@/components/sideNav/index.vue'), SideNav: () => import("@/components/sideNav/index.vue"),
RightPanel: () => import('@/components/rightPanel/index.vue') RightPanel: () => import("@/components/rightPanel/index.vue")
}, },
data() { data() {
return {} return {}
}, },
async created() { async created() {
console.log('this.$http:', this.$http) console.log("this.$http:", this.$http)
let result = await this.$http.get('/webapi/home/banner?type=1&category=18') let result = await this.$http.get("/webapi/home/banner?type=1&category=18")
console.log('result:', result) console.log("result:", result)
} }
} }
</script> </script>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<script> <script>
export default { export default {
components: { components: {
tipPanel: () => import('@/components/header/tipPanel.vue') tipPanel: () => import("@/components/header/tipPanel.vue")
}, },
data() { data() {
return {} return {}
......
import Vue from 'vue' import Vue from "vue"
import App from './App.vue' import App from "./App.vue"
import router from './router' import router from "./router"
import store from './store' import store from "./store"
import './registerServiceWorker' import "./registerServiceWorker"
import axios from 'axios' import axios from "axios"
import baseURL from '../config/baseUrl.js' import baseURL from "../config/baseUrl.js"
console.log('baseURL:', baseURL) console.log("baseURL:", baseURL)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$http = axios Vue.prototype.$http = axios
...@@ -15,4 +15,4 @@ new Vue({ ...@@ -15,4 +15,4 @@ new Vue({
router, router,
store, store,
render: (h) => h(App) render: (h) => h(App)
}).$mount('#app') }).$mount("#app")
/* eslint-disable no-console */ /* eslint-disable no-console */
import { register } from 'register-service-worker' import { register } from "register-service-worker"
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === "production") {
register(`${process.env.BASE_URL}service-worker.js`, { register(`${process.env.BASE_URL}service-worker.js`, {
ready() { ready() {
console.log( console.log(
'App is being served from cache by a service worker.\n' + "App is being served from cache by a service worker.\n" +
'For more details, visit https://goo.gl/AFskqB' "For more details, visit https://goo.gl/AFskqB"
) )
}, },
registered() { registered() {
console.log('Service worker has been registered.') console.log("Service worker has been registered.")
}, },
cached() { cached() {
console.log('Content has been cached for offline use.') console.log("Content has been cached for offline use.")
}, },
updatefound() { updatefound() {
console.log('New content is downloading.') console.log("New content is downloading.")
}, },
updated() { updated() {
console.log('New content is available; please refresh.') console.log("New content is available; please refresh.")
}, },
offline() { offline() {
console.log('No internet connection found. App is running in offline mode.') console.log("No internet connection found. App is running in offline mode.")
}, },
error(error) { error(error) {
console.error('Error during service worker registration:', error) console.error("Error during service worker registration:", error)
} }
}) })
} }
import Vue from 'vue' import Vue from "vue"
import VueRouter from 'vue-router' import VueRouter from "vue-router"
import Bao3 from '../views/bao3.vue' import Bao3 from "../views/bao3.vue"
import Screenshot from '../views/screenshot.vue' import Screenshot from "../views/screenshot.vue"
import screenshotPanel from '../components/rightPanel/screenshotPanel.vue' import screenshotPanel from "../components/rightPanel/screenshotPanel.vue"
Vue.use(VueRouter) Vue.use(VueRouter)
const routes = [ const routes = [
{ {
path: '/', path: "/",
name: 'Bao3', name: "Bao3",
component: Bao3 component: Bao3
}, },
{ {
path: '/about', path: "/about",
name: 'About', name: "About",
// route level code-splitting // route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route // this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited. // which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue') component: () => import(/* webpackChunkName: "about" */ "../views/About.vue")
}, },
{ {
path: '/cutter', path: "/cutter",
name: 'Cutter', name: "Cutter",
component: () => import(/* webpackChunkName: "bao1" */ '../views/videoCutter.vue') component: () => import(/* webpackChunkName: "bao1" */ "../views/videoCutter.vue")
}, },
{ {
path: '/bao2', path: "/bao2",
name: 'Bao2', name: "Bao2",
component: () => import(/* webpackChunkName: "bao2" */ '../views/bao2.vue') component: () => import(/* webpackChunkName: "bao2" */ "../views/bao2.vue")
}, },
{ {
path: '/screenshot', path: "/screenshot",
components: { components: {
default: Screenshot, default: Screenshot,
panel: screenshotPanel panel: screenshotPanel
...@@ -40,7 +40,7 @@ const routes = [ ...@@ -40,7 +40,7 @@ const routes = [
] ]
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: "history",
base: process.env.BASE_URL, base: process.env.BASE_URL,
routes routes
}) })
......
import Vue from 'vue' import Vue from "vue"
import Vuex from 'vuex' import Vuex from "vuex"
Vue.use(Vuex) Vue.use(Vuex)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
export default { export default {
name: 'Screenshot', name: "Screenshot",
data() { data() {
return {} return {}
}, },
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
export default { export default {
name: 'VideoConverterBaby', name: "VideoConverterBaby",
components: {}, components: {},
props: {}, props: {},
data() { data() {
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
</template> </template>
<script> <script>
import VideoPlayer from '@/components/videoCutter/videoPlayer.vue' import VideoPlayer from "@/components/videoCutter/videoPlayer.vue"
export default { export default {
components: { components: {
VideoPlayer VideoPlayer
}, },
data() { data() {
return { return {
name: '' name: ""
} }
}, },
created() {}, created() {},
......
...@@ -4,7 +4,7 @@ console.log(`process.env.NODE_ENV1:`, process.env.NODE_ENV) ...@@ -4,7 +4,7 @@ console.log(`process.env.NODE_ENV1:`, process.env.NODE_ENV)
module.exports = { module.exports = {
// outputDir: process.env.outputDir, // outputDir: process.env.outputDir,
// assetsDir: 'static', // assetsDir: 'static',
publicPath: '/', publicPath: "/",
devServer: { devServer: {
open: true, open: true,
// host: '0.0.0.0', // host: '0.0.0.0',
...@@ -13,10 +13,10 @@ module.exports = { ...@@ -13,10 +13,10 @@ module.exports = {
hotOnly: false, hotOnly: false,
proxy: { proxy: {
webapi: { webapi: {
target: 'https://test2.laihua.com/', target: "https://test2.laihua.com/",
ws: true, ws: true,
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^/webapi': '/' } pathRewrite: { "^/webapi": "/" }
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment