Skip to content

Commit 22bca0c

Browse files
Philipp Bankonierrohityadavcloud
authored andcommitted
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 <[email protected]>
1 parent 7a377c2 commit 22bca0c

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "1.3.0",
44
"private": true,
55
"scripts": {
6-
"start": "vue-cli-service serve",
7-
"serve": "vue-cli-service serve",
6+
"start": "vue-cli-service lint --no-fix && vue-cli-service serve",
7+
"serve": "vue-cli-service lint --no-fix && vue-cli-service serve",
88
"build": "vue-cli-service build",
99
"lint": "vue-cli-service lint",
1010
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'",

ui/src/components/CloudMonkey/Resource.vue

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
<div>
33
<a-breadcrumb class="breadcrumb" v-if="device !== 'desktop'" style="margin-left: -16px; margin-right: -16px; margin-top: -16px">
44
<a-card :bordered="true">
5-
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
6-
<router-link
7-
v-if="item.name"
8-
:to="{ path: item.path === '' ? '/' : item.path }"
9-
>
10-
<a-icon v-if="index == 0" :type="item.meta.icon" />
11-
{{ $t(item.meta.title) }}
12-
</router-link>
13-
<span v-else-if="$route.params.id">
14-
{{ $route.params.id }}
15-
<a-button shape="circle" type="dashed" size="small" v-clipboard:copy="$route.params.id">
16-
<a-icon type="copy" style="margin-left: 0px"/>
17-
</a-button>
18-
</span>
19-
<span v-else>{{ $t(tem.meta.title) }}</span>
20-
</a-breadcrumb-item>
5+
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
6+
<router-link
7+
v-if="item.name"
8+
:to="{ path: item.path === '' ? '/' : item.path }"
9+
>
10+
<a-icon v-if="index == 0" :type="item.meta.icon" />
11+
{{ $t(item.meta.title) }}
12+
</router-link>
13+
<span v-else-if="$route.params.id">
14+
{{ $route.params.id }}
15+
<a-button shape="circle" type="dashed" size="small" v-clipboard:copy="$route.params.id">
16+
<a-icon type="copy" style="margin-left: 0px"/>
17+
</a-button>
18+
</span>
19+
<span v-else>{{ $t(tem.meta.title) }}</span>
20+
</a-breadcrumb-item>
2121
</a-card>
2222
</a-breadcrumb>
2323

ui/src/components/widgets/InstanceView.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
<div class="account-center-detail">
2525
<p>
26-
<status :text="vm.state" style="padding-left: 8px; padding-right: 5px"/>{{ vm.state}}
26+
<status :text="vm.state" style="padding-left: 8px; padding-right: 5px"/>{{ vm.state }}
2727
</p>
2828
<p>
2929
<font-awesome-icon :icon="['fab', osLogo]" size="lg"/> {{ guestOsName }} <br/>
@@ -146,7 +146,7 @@
146146
@tabChange="key => handleTabChange(key, 'noTitleKey')"
147147
>
148148
<span slot="customRender" slot-scope="item">
149-
<a-icon type="home"/>{{item.tab}}
149+
<a-icon type="home"/>{{ item.tab }}
150150
</span>
151151
<a-collapse v-model="activeKey">
152152
<a-collapse-panel :header="'ISO: ' + vm.isoname" v-if="vm.isoid" key="1">
@@ -222,7 +222,6 @@
222222
</a-collapse-panel>
223223
</a-collapse>
224224

225-
226225
</a-card>
227226
</a-col>
228227
</a-row>
@@ -252,11 +251,9 @@ export default {
252251
totalStorage: 0,
253252
guestOsName: '',
254253
osLogo: 'linux',
255-
tags: [],
256254
inputVisible: false,
257255
inputValue: '',
258256
activeKey: ['1', '2', '3'],
259-
260257
tags: ['os=centos', 'tag=value', 'demo=true'],
261258
tagInputVisible: false,
262259
tagInputValue: '',

ui/vue.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ module.exports = {
3838
.set('@layout', resolve('src/layout'))
3939
.set('@static', resolve('src/static'))
4040

41+
// do not emit errors as a warning
42+
config.module.rule('eslint').use('eslint-loader').tap(
43+
opts => ({ ...opts, emitWarning: false })
44+
)
45+
4146
const svgRule = config.module.rule('svg')
4247
svgRule.uses.clear()
4348
svgRule

0 commit comments

Comments
 (0)