Skip to content

Commit 7b32342

Browse files
committed
chore(lint): resolve parsing error
1 parent 738f4c9 commit 7b32342

File tree

5 files changed

+66
-50
lines changed

5 files changed

+66
-50
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/setup-node@v4
2828
with:
2929
node-version: lts/*
30-
cache: 'pnpm'
30+
cache: pnpm
3131

3232
- name: Install dependencies
3333
run: pnpm install --frozen-lockfile
@@ -57,10 +57,10 @@ jobs:
5757
uses: actions/setup-node@v4
5858
with:
5959
node-version: ${{ matrix.node }}
60-
cache: 'pnpm'
60+
cache: pnpm
6161

6262
- name: Install dependencies
6363
run: pnpm install --frozen-lockfile
6464

6565
- name: Build
66-
run: pnpm build:package
66+
run: pnpm build:package

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: lts/*
26-
cache: 'pnpm'
26+
cache: pnpm
2727

2828
- name: Install dependencies
2929
run: pnpm install --frozen-lockfile
@@ -45,4 +45,4 @@ jobs:
4545
- name: Publish to npm
4646
run: pnpm publish --access public --no-git-checks
4747
env:
48-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 55 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ deno install @selemondev/vue3-signature-pad
4444

4545
## Usage
4646

47-
```ts
47+
```vue
4848
<script setup lang="ts">
49-
import { VueSignaturePad } from "@selemondev/vue3-signature-pad"
50-
import { onMounted, ref } from "vue";
49+
import { VueSignaturePad } from '@selemondev/vue3-signature-pad'
50+
import { onMounted, ref } from 'vue'
5151
5252
const state = ref({
5353
options: {
@@ -69,61 +69,73 @@ const colors = [
6969
{
7070
color: 'rgb(255, 85, 51)'
7171
}
72-
];
72+
]
7373
74-
const activeColor = ref();
74+
const activeColor = ref()
7575
76-
const signature = ref();
76+
const signature = ref()
7777
78-
const handleSave = (format?: string) => {
78+
function handleSave(format?: string) {
7979
return alert(signature.value.saveSignature(format))
80-
};
81-
const handleClear = () => {
80+
}
81+
function handleClear() {
8282
return signature.value.clearCanvas()
83-
};
84-
const handleUndo = () => {
83+
}
84+
function handleUndo() {
8585
return signature.value.undo()
86-
};
87-
88-
const handleDisabled = () => {
89-
return state.value.disabled = !state.value.disabled;
90-
};
91-
92-
const handleFromDataURL = (url: string) => {
93-
return signature.value.fromDataURL(url);
94-
};
95-
96-
const handleAddWaterMark = () => {
97-
return signature.value.addWaterMark({
98-
text: "Selemondev", // watermark text, > default ''
99-
font: "20px Arial", // mark font, > default '20px sans-serif'
100-
style: 'all', // fillText and strokeText, 'all'/'stroke'/'fill', > default 'fill
101-
fillStyle: "red", // fillcolor, > default '#333'
102-
strokeStyle: "blue", // strokecolor, > default '#333'
103-
x: 100, // fill positionX, > default 20
104-
y: 200, // fill positionY, > default 20
105-
sx: 100, // stroke positionX, > default 40
106-
sy: 200 // stroke positionY, > default 40
107-
});
86+
}
87+
88+
function handleDisabled() {
89+
return state.value.disabled = !state.value.disabled
90+
}
91+
92+
function handleFromDataURL(url: string) {
93+
return signature.value.fromDataURL(url)
94+
}
95+
96+
function handleAddWaterMark() {
97+
return signature.value.addWaterMark({
98+
text: 'Selemondev', // watermark text, > default ''
99+
font: '20px Arial', // mark font, > default '20px sans-serif'
100+
style: 'all', // fillText and strokeText, 'all'/'stroke'/'fill', > default 'fill
101+
fillStyle: 'red', // fillcolor, > default '#333'
102+
strokeStyle: 'blue', // strokecolor, > default '#333'
103+
x: 100, // fill positionX, > default 20
104+
y: 200, // fill positionY, > default 20
105+
sx: 100, // stroke positionX, > default 40
106+
sy: 200 // stroke positionY, > default 40
107+
})
108108
}
109109
</script>
110110
111111
<template>
112112
<div class="grid place-items-center w-full min-h-screen">
113113
<div class="flex flex-col items-center space-y-4">
114114
<div class="bg-gray-100 p-6">
115-
<VueSignaturePad ref="signature" height="400px" width="1280px" :maxWidth="2" :minWidth="2"
116-
:disabled="state.disabled" />
115+
<VueSignaturePad
116+
ref="signature" height="400px" width="1280px" :max-width="2" :min-width="2"
117+
:disabled="state.disabled"
118+
/>
117119
</div>
118120
119-
<button type="button" @click="handleSave('image/jpeg')">Save</button>
120-
<button type="button" @click="handleClear">Clear</button>
121-
<button type="button" @click="handleUndo">Undo</button>
122-
<button type="button" @click="handleDisabled">Disabled</button>
123-
<button type="button" @click="handleFromDataURL('https://github.com/selemondev.png')">
124-
FromData URL
125-
</button>
126-
<button type="button" @click="handleAddWaterMark">Add watermark</button>
121+
<button type="button" @click="handleSave('image/jpeg')">
122+
Save
123+
</button>
124+
<button type="button" @click="handleClear">
125+
Clear
126+
</button>
127+
<button type="button" @click="handleUndo">
128+
Undo
129+
</button>
130+
<button type="button" @click="handleDisabled">
131+
Disabled
132+
</button>
133+
<button type="button" @click="handleFromDataURL('https://github.com/selemondev.png')">
134+
FromData URL
135+
</button>
136+
<button type="button" @click="handleAddWaterMark">
137+
Add watermark
138+
</button>
127139
</div>
128140
</div>
129141
</template>

eslint.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import antfu from '@antfu/eslint-config'
22

3-
export default antfu()
3+
export default antfu({
4+
rules: {
5+
'style/no-tabs': 'off',
6+
},
7+
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"bugs": {
1515
"url": "https://github.com/selemondev/vue3-signature-pad/issues"
1616
},
17+
"sideEffects": false,
1718
"exports": {
1819
".": "./dist/index.js",
1920
"./package.json": "./package.json"
@@ -34,7 +35,6 @@
3435
"generate:release": "pnpx changelogen@latest --release && npm publish",
3536
"prepublishOnly": "pnpm build"
3637
},
37-
"sideEffects": false,
3838
"peerDependencies": {
3939
"vue": "^3.2.0"
4040
},

0 commit comments

Comments
 (0)