Skip to content

Commit

Permalink
style(lint): lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
BayBreezy committed Jun 20, 2023
1 parent c0fce7e commit 6703849
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/components/Logo.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="inline-flex items-center gap-2">
<img class="object-contain rounded-xl h-8 w-8" src="/icon.png" />
<img class="object-contain rounded-xl h-8 w-8" src="/icon.png">
<span class="font-bold text-lg">Nuxt PDFMake</span>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/BasicExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script setup lang="ts">
import { _colors } from "#tailwind-config/theme";
let pdfLink = ref();
const pdfLink = ref();
const loadPdf = () => {
const { $pdfMake } = useNuxtApp();
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/ColumnsExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script setup lang="ts">
import { _colors } from "#tailwind-config/theme";
let pdfLink = ref();
const pdfLink = ref();
const loadPdf = () => {
const { $pdfMake } = useNuxtApp();
Expand Down
12 changes: 5 additions & 7 deletions docs/components/content/ImageExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,22 @@
</template>

<script setup lang="ts">
import { _colors } from "#tailwind-config/theme";
let pdfLink = ref();
const pdfLink = ref();
const getBase64ImageFromURL = (url: string) => {
return new Promise((resolve, reject) => {
var img = new Image();
const img = new Image();
img.setAttribute("crossOrigin", "anonymous");
img.onload = () => {
var canvas = document.createElement("canvas");
const canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
const ctx = canvas.getContext("2d");
ctx?.drawImage(img, 0, 0);
var dataURL = canvas.toDataURL("image/jpeg");
const dataURL = canvas.toDataURL("image/jpeg");
resolve(dataURL);
};
Expand Down Expand Up @@ -50,7 +48,7 @@ const loadPdf = async () => {
margin: [0, 0, 0, 20],
},
{
image: img,
image: img as any,
width: 350,
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/ListExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script setup lang="ts">
import { _colors } from "#tailwind-config/theme";
let pdfLink = ref();
const pdfLink = ref();
const loadPdf = () => {
const { $pdfMake } = useNuxtApp();
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/RentExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script setup lang="ts">
import { _colors } from "#tailwind-config/theme";
let pdfLink = ref();
const pdfLink = ref();
const loadPdf = async () => {
const { $pdfMake } = useNuxtApp();
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/StyleOneExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script setup lang="ts">
import { _colors } from "#tailwind-config/theme";
let pdfLink = ref();
const pdfLink = ref();
const loadPdf = () => {
const { $pdfMake } = useNuxtApp();
Expand Down
8 changes: 3 additions & 5 deletions docs/components/content/TableExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
</template>

<script setup lang="ts">
import { _colors } from "#tailwind-config/theme";
let pdfLink = ref();
const pdfLink = ref();
const loadPdf = () => {
const { $pdfMake } = useNuxtApp();
Expand Down Expand Up @@ -404,10 +402,10 @@ const loadPdf = () => {
vLineWidth: function (i, node) {
return i === 0 || i === node.table.widths?.length ? 2 : 1;
},
hLineColor: function (i, node) {
hLineColor: function () {
return "black";
},
vLineColor: function (i, node) {
vLineColor: function () {
return "black";
},
hLineStyle: function (i, node) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
"start:dev": "npm run prepack && npm run dev:build && node playground/.output/server/index.mjs",
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
"lint": "eslint .",
"lint": "eslint . --fix",
"test": "vitest run",
"test:watch": "vitest watch"
},
Expand All @@ -58,4 +58,4 @@
"nuxt": "^3.5.3",
"vitest": "^0.31.4"
}
}
}
5 changes: 4 additions & 1 deletion playground/app.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<div>
<UContainer>
<UButton label="Export" @click="exportData" />
<UButton
label="Export"
@click="exportData"
/>
</UContainer>
</div>
</template>
Expand Down

0 comments on commit 6703849

Please sign in to comment.