Commit 8325f152 authored by huanglu's avatar huanglu

增加eslint

parent b40458fa
> 1%
last 2 versions
not dead
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/essential',
'@vue/airbnb',
],
parserOptions: {
parser: 'babel-eslint',
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'comma-dangle': 0,
'comma-spacing': 0,// 逗号前后的空格
'comma-style': [2, 'last'],// 逗号风格,换行时在行首还是行尾
quotes: [1, 'single'],
eqeqeq: 2,
'indent': [2, 2], // 强制使用一致的缩进
'no-var': 1,
'key-spacing': [2, { beforeColon: false, afterColon: true }],// 对象字面量中冒号的前后空格
semi: 0,
'semi-spacing': [0, { before: false, after: true }], // 分号前后空格,
'use-isnan': 2, // 禁止比较时使用NaN,只能用isNaN()
'prefer-promise-reject-errors': 0,
'no-param-reassign': 0,
'no-unused-vars': 1,
'no-shadow': 0,
'import/extensions': 0,
'import/prefer-default-export': 1
},
};
......@@ -17,7 +17,6 @@ module.exports = {
externals: {
},
alias: {
},
pages
}
......@@ -32,25 +32,6 @@
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^3.6.1"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"@vue/airbnb"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
],
"gitHooks": {
"pre-commit": "lint-staged"
},
......
import HelloWorld from './hello-world'
export {
HelloWorld
}
\ No newline at end of file
<template>
<div id="app">
this is home
<router-link to='Cart'>cart</router-link>
<keep-alive>
<router-view v-if="$route.meta.keepAlive"/>
</keep-alive>
......
import Vue from 'vue';
import App from './App.vue';
import router, { multiRouter } from './router';
import router from './router';
import store from './store';
Vue.config.productionTip = false;
......
......@@ -2,19 +2,20 @@ import Vue from "vue";
import VueRouter from "vue-router";
import globalRoutes from '@/router'
const About = () => import('../views/about');
const Index = () => import('../views/Index');
Vue.use(VueRouter);
// 单入口路由配置
const routes = [
{
path: "/about",
name: "About",
component: About
path: "/",
name: "index",
component: Index
}
];
const router = new VueRouter({
mode: "hash",
base: process.env.BASE_URL,
......
<template>
<div class="about">
<h1>This is an about page</h1>
<h1>This is an Index page</h1>
</div>
</template>
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