Enhancement/linting (#34)

* Stop emitting lint errors as warnings

* Execute lint on inital serve for development

* Fix linting errors

* Fix linting warnings

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Philipp Bankonier 2019-09-12 19:28:47 +02:00 committed by Rohit Yadav
parent 7a377c22e0
commit 22bca0c248
4 changed files with 25 additions and 23 deletions

View File

@ -3,8 +3,8 @@
"version": "1.3.0",
"private": true,
"scripts": {
"start": "vue-cli-service serve",
"serve": "vue-cli-service serve",
"start": "vue-cli-service lint --no-fix && vue-cli-service serve",
"serve": "vue-cli-service lint --no-fix && vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'",

View File

@ -2,22 +2,22 @@
<div>
<a-breadcrumb class="breadcrumb" v-if="device !== 'desktop'" style="margin-left: -16px; margin-right: -16px; margin-top: -16px">
<a-card :bordered="true">
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
<router-link
v-if="item.name"
:to="{ path: item.path === '' ? '/' : item.path }"
>
<a-icon v-if="index == 0" :type="item.meta.icon" />
{{ $t(item.meta.title) }}
</router-link>
<span v-else-if="$route.params.id">
{{ $route.params.id }}
<a-button shape="circle" type="dashed" size="small" v-clipboard:copy="$route.params.id">
<a-icon type="copy" style="margin-left: 0px"/>
</a-button>
</span>
<span v-else>{{ $t(tem.meta.title) }}</span>
</a-breadcrumb-item>
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
<router-link
v-if="item.name"
:to="{ path: item.path === '' ? '/' : item.path }"
>
<a-icon v-if="index == 0" :type="item.meta.icon" />
{{ $t(item.meta.title) }}
</router-link>
<span v-else-if="$route.params.id">
{{ $route.params.id }}
<a-button shape="circle" type="dashed" size="small" v-clipboard:copy="$route.params.id">
<a-icon type="copy" style="margin-left: 0px"/>
</a-button>
</span>
<span v-else>{{ $t(tem.meta.title) }}</span>
</a-breadcrumb-item>
</a-card>
</a-breadcrumb>

View File

@ -23,7 +23,7 @@
</div>
<div class="account-center-detail">
<p>
<status :text="vm.state" style="padding-left: 8px; padding-right: 5px"/>{{ vm.state}}
<status :text="vm.state" style="padding-left: 8px; padding-right: 5px"/>{{ vm.state }}
</p>
<p>
<font-awesome-icon :icon="['fab', osLogo]" size="lg"/> {{ guestOsName }} <br/>
@ -146,7 +146,7 @@
@tabChange="key => handleTabChange(key, 'noTitleKey')"
>
<span slot="customRender" slot-scope="item">
<a-icon type="home"/>{{item.tab}}
<a-icon type="home"/>{{ item.tab }}
</span>
<a-collapse v-model="activeKey">
<a-collapse-panel :header="'ISO: ' + vm.isoname" v-if="vm.isoid" key="1">
@ -222,7 +222,6 @@
</a-collapse-panel>
</a-collapse>
</a-card>
</a-col>
</a-row>
@ -252,11 +251,9 @@ export default {
totalStorage: 0,
guestOsName: '',
osLogo: 'linux',
tags: [],
inputVisible: false,
inputValue: '',
activeKey: ['1', '2', '3'],
tags: ['os=centos', 'tag=value', 'demo=true'],
tagInputVisible: false,
tagInputValue: '',

View File

@ -38,6 +38,11 @@ module.exports = {
.set('@layout', resolve('src/layout'))
.set('@static', resolve('src/static'))
// do not emit errors as a warning
config.module.rule('eslint').use('eslint-loader').tap(
opts => ({ ...opts, emitWarning: false })
)
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule