Skip to content

Commit 8403c40

Browse files
committed
Enforce code styling
1 parent 5da1716 commit 8403c40

File tree

7 files changed

+62
-15
lines changed

7 files changed

+62
-15
lines changed

Diff for: package.json

+33-2
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,47 @@
4444
"browser": true
4545
},
4646
"extends": [
47-
"plugin:vue/vue3-essential",
4847
"eslint:recommended",
48+
"plugin:vue/vue3-recommended",
4949
"@vue/typescript/recommended"
5050
],
5151
"parserOptions": {
5252
"ecmaVersion": 2020
5353
},
5454
"rules": {
5555
"@typescript-eslint/ban-ts-comment": "off",
56-
"@typescript-eslint/no-non-null-assertion": "off"
56+
"@typescript-eslint/no-non-null-assertion": "off",
57+
"@typescript-eslint/type-annotation-spacing": "warn",
58+
"vue/max-attributes-per-line": [
59+
"warn",
60+
{
61+
"singleline": {
62+
"max": 3
63+
}
64+
}
65+
],
66+
"vue/singleline-html-element-content-newline": "off",
67+
"vue/html-closing-bracket-newline": "off",
68+
"vue/array-bracket-spacing": "warn",
69+
"vue/arrow-spacing": "warn",
70+
"vue/block-spacing": "warn",
71+
"vue/comma-spacing": "warn",
72+
"vue/key-spacing": [
73+
"warn",
74+
{
75+
"beforeColon": false,
76+
"afterColon": true
77+
}
78+
],
79+
"vue/keyword-spacing": "warn",
80+
"vue/object-curly-spacing": [
81+
"warn",
82+
"always"
83+
],
84+
"vue/prefer-template": "warn",
85+
"vue/space-infix-ops": "warn",
86+
"vue/space-unary-ops": "warn",
87+
"vue/template-curly-spacing": "warn"
5788
}
5889
},
5990
"browserslist": [

Diff for: src/App.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@
88
</a-button>
99
</a-col>
1010
<a-col>
11-
<a-upload :customRequest="loadGerber" :showUploadList="false">
11+
<a-upload :custom-request="loadGerber" :show-upload-list="false">
1212
<a-button type="primary" :loading="loading">打开 Gerber 文件</a-button>
1313
</a-upload>
1414
</a-col>
1515
</a-row>
1616
</template>
1717
<a-tab-pane key="options" tab="选项">
1818
<x-panel>
19-
<render-panel v-model:side="render.side" v-model:sm="render.sm" v-model:cf="render.cf" v-model:sp="render.sp" />
19+
<render-panel
20+
v-model:side="render.side"
21+
v-model:sm="render.sm"
22+
v-model:cf="render.cf"
23+
v-model:sp="render.sp" />
2024
<layers-panel v-model:layers="layers" />
2125
</x-panel>
2226
</a-tab-pane>

Diff for: src/components/GerberView.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div :class="$style.container" :ref="(ref) => containerRef = (ref as HTMLElement)">
2+
<div :ref="(ref) => containerRef = (ref as HTMLElement)" :class="$style.container">
33
<canvas :ref="(ref) => canvasRef = (ref as HTMLCanvasElement)" :class="{ [$style.dragging]: dragging }" />
44
</div>
55
</template>

Diff for: src/components/XPanelContainer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="x-panel-container" :ref="(ref) => container = ref as Element">
2+
<div :ref="(ref) => container = ref as Element" class="x-panel-container">
33
<a-tabs type="card" @change="handleTabChange">
44
<template #rightExtra>
55
<slot name="extra" />

Diff for: src/panels/LayersPanel.vue

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
<template>
22
<panel-unit title="图层">
3-
<a-button @click="showLayers" :disabled="props.layers.length == 0">打开图层设置</a-button>
3+
<a-button :disabled="props.layers.length == 0" @click="showLayers">打开图层设置</a-button>
44
</panel-unit>
5-
<a-modal v-model:visible="layersShown" title="图层设置" centered width="1000px">
5+
<a-modal
6+
v-model:visible="layersShown"
7+
title="图层设置"
8+
centered
9+
width="1000px">
610
<a-row type="flex" :gutter="[8, 8]">
711
<template v-for="layer in layers" :key="layer.filename!">
812
<a-col :xs="24" :md="14" :lg="16">
9-
<span :class="$style.layerName">{{layer.filename}}</span>
13+
<span :class="$style.layerName">{{ layer.filename }}</span>
1014
</a-col>
1115
<a-col :xs="24" :md="10" :lg="8">
1216
<a-space>
13-
<a-select v-model:value="layer.type" :options="gerberTypes" :style="{ width: '6em' }"
17+
<a-select
18+
v-model:value="layer.type"
19+
:options="gerberTypes"
20+
:style="{ width: '6em' }"
1421
@change="guessLayerSide(layer)" />
15-
<a-radio-group v-model:value="layer.side" v-if="hasSide(layer.type)">
22+
<a-radio-group v-if="hasSide(layer.type)" v-model:value="layer.side">
1623
<a-radio-button value="top">顶层</a-radio-button>
1724
<a-radio-button value="bottom">底层</a-radio-button>
18-
<a-radio-button value="inner" v-if="layer.type == 'copper'">内层</a-radio-button>
25+
<a-radio-button v-if="layer.type == 'copper'" value="inner">内层</a-radio-button>
1926
</a-radio-group>
2027
</a-space>
2128
</a-col>

Diff for: src/panels/OutputPanel.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@
3232
</a-row>
3333
</a-form-item>
3434
<div>
35-
<a-button type="primary" :disabled="props.layers.length == 0" :loading="rendering" @click="output">输出文件</a-button>
35+
<a-button
36+
type="primary"
37+
:disabled="props.layers.length == 0"
38+
:loading="rendering"
39+
@click="output">
40+
输出文件
41+
</a-button>
3642
</div>
3743
</panel-unit>
3844
</template>

Diff for: src/panels/RenderPanel.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
<a-form-item label="阻焊">
1414
<a-row type="flex" :gutter="[8, 8]">
1515
<a-col>
16-
<a-select :value="props.sm" @update:value="(v: RenderSolderMask) => emit('update:sm', v)"
17-
:style="{ width: '10em' }">
16+
<a-select :value="props.sm" :style="{ width: '10em' }" @update:value="(v: RenderSolderMask) => emit('update:sm', v)">
1817
<a-select-option value="green">绿色</a-select-option>
1918
<a-select-option value="red">红色</a-select-option>
2019
<a-select-option value="yellow">黄色</a-select-option>

0 commit comments

Comments
 (0)