From 6a422ca6432400aae118c7fffa91d681620495af Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 11 Jan 2024 22:23:18 +0530 Subject: [PATCH] chore: Fix issues --- .prettierrc | 2 +- cypress/e2e/util.ts | 2 +- src/app.html | 2 +- src/app.postcss | 2 +- src/lib/util/fileLoaders/gist.ts | 2 +- src/lib/util/persist.ts | 2 +- src/lib/util/stats.ts | 34 ++++++++++++++++---------------- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.prettierrc b/.prettierrc index 05532cf8..e0366fc9 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,6 +4,6 @@ "bracketSameLine": true, "trailingComma": "none", "printWidth": 100, - "tailwindConfig": "./tailwind.config.cjs", + "tailwindConfig": "./tailwind.config.cjs", "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"] } diff --git a/cypress/e2e/util.ts b/cypress/e2e/util.ts index 57a9f54b..456ae585 100644 --- a/cypress/e2e/util.ts +++ b/cypress/e2e/util.ts @@ -11,7 +11,7 @@ export const typeInEditor = ( ) => { cy.window().should('have.property', 'editorLoaded', true); cy.get('#editor').click(); - cy.get('#editor').within(($editor) => { + cy.get('#editor').within(() => { if (bottom) { cy.get('textarea').type('{pageDown}', { force: true }); } diff --git a/src/app.html b/src/app.html index e2469685..9b8d5a11 100644 --- a/src/app.html +++ b/src/app.html @@ -1,4 +1,4 @@ - + diff --git a/src/app.postcss b/src/app.postcss index 888c737e..73ce33f0 100644 --- a/src/app.postcss +++ b/src/app.postcss @@ -3,7 +3,7 @@ @tailwind utilities; .input { - @apply flex-1 border-primary border-solid border-2 rounded; + @apply flex-1 rounded border-2 border-solid border-primary; } .action-btn { @apply btn btn-primary; diff --git a/src/lib/util/fileLoaders/gist.ts b/src/lib/util/fileLoaders/gist.ts index 974e24dc..ca36a654 100644 --- a/src/lib/util/fileLoaders/gist.ts +++ b/src/lib/util/fileLoaders/gist.ts @@ -109,7 +109,7 @@ export const loadGistData = async (gistURL: string): Promise => { throw new Error('Invalid gist provided'); } gistHistory.reverse(); - const entry = gistHistory.slice(-1).pop(); + const entry = gistHistory.at(-1); if (!entry) { throw new Error('Invalid gist provided'); } diff --git a/src/lib/util/persist.ts b/src/lib/util/persist.ts index 418ede1a..2c63b9a2 100644 --- a/src/lib/util/persist.ts +++ b/src/lib/util/persist.ts @@ -213,7 +213,7 @@ function getBrowserStorage( disconnect(); } }, - getValue(key: string): any | null { + getValue(key: string): any { const value = browserStorage.getItem(key); return deserialize(value); }, diff --git a/src/lib/util/stats.ts b/src/lib/util/stats.ts index 4e70e64c..82d1c5fc 100644 --- a/src/lib/util/stats.ts +++ b/src/lib/util/stats.ts @@ -35,7 +35,7 @@ export const detectType = (text: string): string | undefined => { 'mindmap' ]; const firstLine = text - .replace(/^\s*%%.*\n/g, '\n') + .replaceAll(/^\s*%%.*\n/g, '\n') .trimStart() .split(' ')[0] .toLowerCase(); @@ -57,22 +57,22 @@ export const saveStatistics = (graph: string): void => { length < 10 ? '0-10' : length < 25 - ? '10-25' - : length < 50 - ? '25-50' - : length < 100 - ? '50-100' - : length < 200 - ? '100-200' - : length < 500 - ? '200-500' - : length < 700 - ? '500-700' - : length < 1000 - ? '700-1000' - : length < 1500 - ? '1000-1500' - : '1500+'; + ? '10-25' + : length < 50 + ? '25-50' + : length < 100 + ? '50-100' + : length < 200 + ? '100-200' + : length < 500 + ? '200-500' + : length < 700 + ? '500-700' + : length < 1000 + ? '700-1000' + : length < 1500 + ? '1000-1500' + : '1500+'; logEvent('render', { graphType, length, lengthBucket }); };