Skip to content

Commit

Permalink
chore: eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
schoero committed Sep 1, 2024
1 parent 99c31f2 commit 931b85c
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/importing.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ The bundle exposes all exports in the global variable `SwissQRBill`.

```ts
const SwissQRBill = {
errors,
PDF,
SVG,
errors,
table,
types,
utils
Expand Down
5 changes: 2 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import sharedRules from "@schoero/configs/eslint";
import eslintPluginTypeScript from "@typescript-eslint/eslint-plugin";
import eslintParserTypeScript from "@typescript-eslint/parser";

import sharedRules from "@schoero/configs/eslint";

/** @type { import("eslint").Linter.FlatConfig[] } */
/** @type { import("eslint").Linter.Config[] } */
export default [
...sharedRules,

Expand Down
5 changes: 3 additions & 2 deletions examples/browser-bundling-with-webpack/src/pdf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import BlobStream from "blob-stream";
import fs from "fs";

import BlobStream from "blob-stream";
import PDFDocument from "pdfkit";
import Helvetica from "pdfkit/js/data/Helvetica.afm";
import HelveticaBold from "pdfkit/js/data/Helvetica-Bold.afm";
import Helvetica from "pdfkit/js/data/Helvetica.afm";
import { SwissQRBill } from "swissqrbill/pdf";


Expand Down
1 change: 1 addition & 0 deletions examples/how-to-create-a-complete-qr-bill/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createWriteStream } from "fs";

import PDFDocument from "pdfkit";
import { SwissQRBill, Table } from "swissqrbill/pdf";
import { mm2pt } from "swissqrbill/utils";
Expand Down
1 change: 1 addition & 0 deletions examples/node-cjs-javascript/src/pdf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { createWriteStream } = require("fs");

const PDFDocument = require("pdfkit");
const { SwissQRBill } = require("swissqrbill/pdf");

Expand Down
1 change: 1 addition & 0 deletions examples/node-cjs-javascript/src/svg.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { writeFileSync } = require("fs");

const { SwissQRBill } = require("swissqrbill/svg");

const data = require("./data.js");
Expand Down
1 change: 1 addition & 0 deletions examples/node-esm-javascript/src/pdf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createWriteStream } from "fs";

import PDFDocument from "pdfkit";
import { SwissQRBill } from "swissqrbill/pdf";

Expand Down
1 change: 1 addition & 0 deletions examples/node-esm-javascript/src/svg.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { writeFileSync } from "fs";

import { SwissQRBill } from "swissqrbill/svg";

import { data } from "./data.js";
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable eslint-plugin-simple-import-sort/exports */
/* eslint-disable eslint-plugin-perfectionist/sort-exports */
export * as pdf from "swissqrbill:pdf";
export * as svg from "swissqrbill:svg";
export * as types from "swissqrbill:types";
Expand Down
2 changes: 1 addition & 1 deletion src/svg/character-width.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export const arial10pt = {
99: 6.5
};

export function calculateTextWidth(text: string, size: "8pt" | "10pt") {
export function calculateTextWidth(text: string, size: "10pt" | "8pt") {
let width = 0;
if(size === "8pt"){
for(let c = 0; c < text.length; c++){
Expand Down
6 changes: 3 additions & 3 deletions src/svg/swissqrbill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ export class SwissQRBill {
}


private _getLineCountOfText(text: string | undefined, lengthInPixel: number, size: "8pt" | "10pt") {
private _getLineCountOfText(text: string | undefined, lengthInPixel: number, size: "10pt" | "8pt") {
if(text === undefined){
return 0;
} else {
Expand All @@ -590,7 +590,7 @@ export class SwissQRBill {
}


private _fitTextToWidth(text: string, lengthInPixel: number, maxLines: number, size: "8pt" | "10pt"): string[] {
private _fitTextToWidth(text: string, lengthInPixel: number, maxLines: number, size: "10pt" | "8pt"): string[] {

const remainder = text.split(/([ |-])/g);
let lines: string[] = [];
Expand Down Expand Up @@ -654,7 +654,7 @@ export class SwissQRBill {
}


private _ellipsis(text: string, lengthInPixel: number, size: "8pt" | "10pt"): string {
private _ellipsis(text: string, lengthInPixel: number, size: "10pt" | "8pt"): string {

let result = "";

Expand Down
3 changes: 1 addition & 2 deletions vite.config.cjs.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { config, defineConfig } from "@schoero/configs/vite";
import { sync } from "glob";
import dts from "vite-plugin-dts";
import noBundlePlugin from "vite-plugin-no-bundle";

import { config, defineConfig } from "@schoero/configs/vite";

import type { UserConfig } from "vite";


Expand Down
3 changes: 1 addition & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { config, defineConfig } from "@schoero/configs/vite";
import { sync } from "glob";
import dts from "vite-plugin-dts";
import noBundlePlugin from "vite-plugin-no-bundle";

import { config, defineConfig } from "@schoero/configs/vite";

import type { UserConfig } from "vite";


Expand Down

0 comments on commit 931b85c

Please sign in to comment.