diff --git a/functions/src/index.ts b/functions/src/index.ts index c171f0c..3359891 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -10,7 +10,7 @@ admin.initializeApp() const db = admin.firestore() exports.presentation = functions.https.onRequest((req, res) => - presentation(req, res, db) + presentation(req, res, db), ) exports.removeOldSlides = functions.firestore @@ -18,5 +18,5 @@ exports.removeOldSlides = functions.firestore .onCreate(() => removeOldSlides(db)) exports.updateLastVisit = functions.https.onRequest((req, res) => - updateLastVisit(req, res, db) + updateLastVisit(req, res, db), ) diff --git a/functions/src/presentation.ts b/functions/src/presentation.ts index 3f0cf23..b5fd151 100644 --- a/functions/src/presentation.ts +++ b/functions/src/presentation.ts @@ -4,7 +4,7 @@ import * as functions from 'firebase-functions' export const presentation = async ( req: functions.Request, res: functions.Response, - db: admin.firestore.Firestore + db: admin.firestore.Firestore, ) => { const { id } = req.query diff --git a/functions/src/remove-old-slides.ts b/functions/src/remove-old-slides.ts index 56c4d32..ff00c12 100644 --- a/functions/src/remove-old-slides.ts +++ b/functions/src/remove-old-slides.ts @@ -22,7 +22,7 @@ export const removeOldSlides = async (db: admin.firestore.Firestore) => { const slides = await getOldSlides(db) console.log( - `${slides.size} slides created before ${dateThirtyDaysAgo.toJSON()}` + `${slides.size} slides created before ${dateThirtyDaysAgo.toJSON()}`, ) slides.forEach(async (slide) => { @@ -35,7 +35,7 @@ export const removeOldSlides = async (db: admin.firestore.Firestore) => { console.log( `${slide.id}: Removed (last visit: ${ visitedAt ? visitedAt.toDate().toJSON() : 'unknown' - })` + })`, ) } catch (err) { if (err instanceof Error) { @@ -46,7 +46,7 @@ export const removeOldSlides = async (db: admin.firestore.Firestore) => { console.log( `${slide.id}: Not removing (last visit: ${ visitedAt ? visitedAt.toDate().toJSON() : 'unknown' - })` + })`, ) } }) diff --git a/functions/src/update-last-visit.ts b/functions/src/update-last-visit.ts index 62a58e3..229c900 100644 --- a/functions/src/update-last-visit.ts +++ b/functions/src/update-last-visit.ts @@ -4,7 +4,7 @@ import * as functions from 'firebase-functions' export const updateLastVisit = async ( req: functions.Request, res: functions.Response, - db: admin.firestore.Firestore + db: admin.firestore.Firestore, ) => { const { id } = req.query diff --git a/index.html b/index.html index 1d9a3fb..5d66f63 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + diff --git a/package-lock.json b/package-lock.json index f3b27b2..6a77a6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,11 +38,11 @@ "@typescript-eslint/parser": "^7.10.0", "@vitejs/plugin-react": "^4.2.1", "eslint": "^8.57.0", - "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.34.1", "firebase-tools": "^11.18.0", "postcss-styled-syntax": "^0.6.4", - "prettier": "^2.7.1", + "prettier": "^3.2.5", "react-test-renderer": "^18.2.0", "stylelint": "^16.5.0", "stylelint-config-recommended": "^14.0.0", @@ -3248,6 +3248,18 @@ "node": ">=10.13.0" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -6002,21 +6014,30 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", - "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", "dev": true, "dependencies": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" }, "engines": { - "node": ">=6.0.0" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { - "eslint": ">=7.28.0", - "prettier": ">=2.0.0" + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" }, "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, "eslint-config-prettier": { "optional": true } @@ -17839,15 +17860,15 @@ } }, "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -19283,6 +19304,22 @@ "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==", "dev": true }, + "node_modules/synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/table": { "version": "6.8.2", "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", @@ -19463,9 +19500,9 @@ } }, "node_modules/tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/type-check": { "version": "0.4.0", diff --git a/package.json b/package.json index 6028a1a..234b869 100644 --- a/package.json +++ b/package.json @@ -51,11 +51,11 @@ "@typescript-eslint/parser": "^7.10.0", "@vitejs/plugin-react": "^4.2.1", "eslint": "^8.57.0", - "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.34.1", "firebase-tools": "^11.18.0", "postcss-styled-syntax": "^0.6.4", - "prettier": "^2.7.1", + "prettier": "^3.2.5", "react-test-renderer": "^18.2.0", "stylelint": "^16.5.0", "stylelint-config-recommended": "^14.0.0", diff --git a/src/components/Button/Button.test.tsx b/src/components/Button/Button.test.tsx index a63b7d1..b4c1983 100644 --- a/src/components/Button/Button.test.tsx +++ b/src/components/Button/Button.test.tsx @@ -9,7 +9,7 @@ it('renders correctly', () => { .create( - + , ) .toJSON() diff --git a/src/components/Editor/Editor.test.tsx b/src/components/Editor/Editor.test.tsx index 49f48b3..8ad9bcc 100644 --- a/src/components/Editor/Editor.test.tsx +++ b/src/components/Editor/Editor.test.tsx @@ -12,7 +12,7 @@ it('renders correctly', () => { onChange={() => {}} value="Test" /> - + , ) .toJSON() @@ -44,7 +44,7 @@ it('renders correctly with disabled and isLoading', () => { progress={50} value="Test" /> - + , ) .toJSON() diff --git a/src/components/Editor/utils.ts b/src/components/Editor/utils.ts index 91ccf1f..92a167e 100644 --- a/src/components/Editor/utils.ts +++ b/src/components/Editor/utils.ts @@ -11,13 +11,13 @@ export const getSlidesFirstLines = (value = ''): Slide[] => .split('\n') .reduce( (prev, curr, index) => (curr === '---' ? [...prev, index + 1] : prev), - [0] + [0], ) .map((lines, index) => ({ slide: index, firstLine: lines })) export const getCurrentSlide = ( slides: Slide[], - currentLineNumber: number + currentLineNumber: number, ): number => { const slideObj = [...slides] .reverse() diff --git a/src/components/Icon/Icon.test.tsx b/src/components/Icon/Icon.test.tsx index 7bd122f..44822f0 100644 --- a/src/components/Icon/Icon.test.tsx +++ b/src/components/Icon/Icon.test.tsx @@ -31,7 +31,7 @@ it('renders correctly with tooltip', () => { + />, ) .toJSON() diff --git a/src/components/Logo/Logo.test.tsx b/src/components/Logo/Logo.test.tsx index 71c96d2..2d1dae5 100644 --- a/src/components/Logo/Logo.test.tsx +++ b/src/components/Logo/Logo.test.tsx @@ -9,7 +9,7 @@ it('renders correctly', () => { .create( - + , ) .toJSON() diff --git a/src/components/Notification/Notification.test.tsx b/src/components/Notification/Notification.test.tsx index a8eb89a..e4f26ca 100644 --- a/src/components/Notification/Notification.test.tsx +++ b/src/components/Notification/Notification.test.tsx @@ -7,7 +7,7 @@ import { Notification } from '.' const component = renderer.create( Test - + , ) it('renders correctly', () => { diff --git a/src/components/Slide/Slide.test.tsx b/src/components/Slide/Slide.test.tsx index 2f03100..d03a814 100644 --- a/src/components/Slide/Slide.test.tsx +++ b/src/components/Slide/Slide.test.tsx @@ -24,7 +24,7 @@ it('renders correctly', () => { scale={1} width={800} /> - + , ) .toJSON() diff --git a/src/components/Slide/Slide.tsx b/src/components/Slide/Slide.tsx index e288b44..485349f 100644 --- a/src/components/Slide/Slide.tsx +++ b/src/components/Slide/Slide.tsx @@ -49,8 +49,8 @@ const Slide = memo( - ) - ) + ), + ), ) export { Slide } diff --git a/src/components/Slides/Slides.tsx b/src/components/Slides/Slides.tsx index d753401..b8afaf0 100644 --- a/src/components/Slides/Slides.tsx +++ b/src/components/Slides/Slides.tsx @@ -99,7 +99,7 @@ const Slides = ({ single={singleSlide !== undefined} width={width} /> - ) + ), ) useWindowResizeObserver(handleResize) diff --git a/src/components/Spinner/Spinner.test.tsx b/src/components/Spinner/Spinner.test.tsx index 8664595..2328ce4 100644 --- a/src/components/Spinner/Spinner.test.tsx +++ b/src/components/Spinner/Spinner.test.tsx @@ -9,7 +9,7 @@ it('renders correctly', () => { .create( - + , ) .toJSON() diff --git a/src/firebase.ts b/src/firebase.ts index 873ff40..0ae3f6a 100644 --- a/src/firebase.ts +++ b/src/firebase.ts @@ -70,7 +70,7 @@ export const createSlides = async ({ await setDoc( doc(db, SLIDES_COLLECTION, id), { createdAt: new Date(), markdown, presentationId, theme }, - { merge: true } + { merge: true }, ) } catch (error) { console.error('Error adding document: ', error) @@ -128,9 +128,9 @@ export const saveImage = async ({ 'state_changed', (snapshot) => onChange( - Math.round((snapshot.bytesTransferred / snapshot.totalBytes) * 100) + Math.round((snapshot.bytesTransferred / snapshot.totalBytes) * 100), ), (error) => onError(error), - () => onDone(uploadTask.snapshot) + () => onDone(uploadTask.snapshot), ) } diff --git a/src/views/Presentation/Presentation.tsx b/src/views/Presentation/Presentation.tsx index 5515e0d..cf30b61 100644 --- a/src/views/Presentation/Presentation.tsx +++ b/src/views/Presentation/Presentation.tsx @@ -49,7 +49,7 @@ const Presentation = () => { } } }, - [state, navigate, presentationId, slideNumberAsNumber] + [state, navigate, presentationId, slideNumberAsNumber], ) useEffect(() => { @@ -91,7 +91,7 @@ const Presentation = () => { toolbarVisibilityTimer.current = setTimeout( () => setIsToolbarVisible(false), - 2000 + 2000, ) }