From 03a3518aae59c01b32e6d2d13defe0bfef107871 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Fri, 16 Jan 2026 09:16:29 +0000 Subject: [PATCH] Merge pull request #30703 from overleaf/ae-prettier Upgrade Prettier to v3.7.4 GitOrigin-RevId: 0f4434019bc7d12f2d5b7ecbb833ee20570d0706 --- .../eslint-plugin/require-loading-label.js | 18 ++--- .../require-vi-doMock-valid-path.js | 65 ++++++++++++------- libraries/eslint-plugin/rules.test.js | 43 +++++++----- package-lock.json | 8 +-- package.json | 2 +- .../acceptance/js/storage/support/cleanup.js | 5 +- .../AuthenticationController.mjs | 4 +- .../Authentication/AuthenticationErrors.mjs | 3 +- .../Project/ProjectListController.mjs | 12 ++-- .../src/Features/Subscription/AiHelper.mjs | 4 +- .../src/Features/Subscription/PlansHelper.mjs | 2 +- .../Subscription/SubscriptionLocator.mjs | 2 +- .../UserMembershipController.mjs | 6 +- .../web/app/src/infrastructure/Features.mjs | 2 +- .../js/features/cookie-banner/utils.ts | 6 +- .../file-view/components/file-view-pdf.tsx | 5 +- .../context/editor-manager-context.tsx | 3 +- .../js/features/ide-react/types/file-tree.ts | 9 +-- .../components/modals/manage-tag-modal.tsx | 6 +- .../actions/make-primary/make-primary.tsx | 4 +- .../settings/components/emails/row.tsx | 2 +- .../components/share-modal-body.tsx | 2 +- .../components/table-generator/cell-input.tsx | 3 +- .../extensions/bracket-matching.ts | 4 +- .../extensions/visual/atomic-decorations.ts | 2 +- .../visual/visual-widgets/graphics.ts | 5 +- .../js/features/source-editor/utils/layer.ts | 1 - .../dashboard/states/active/active.tsx | 4 +- .../subscription-dashboard-context.tsx | 14 ++-- .../js/infrastructure/error-reporter.ts | 8 +-- .../js/shared/components/recaptcha-2.tsx | 6 +- .../js/shared/context/editor-context.tsx | 2 +- .../src/Analytics/EmailChangeHelpers.test.mjs | 4 +- .../types/project/dashboard/notification.ts | 6 +- .../web/types/recurly/pricing/subscription.ts | 3 +- .../web/types/review-panel/comment-thread.ts | 6 +- 36 files changed, 144 insertions(+), 137 deletions(-) diff --git a/libraries/eslint-plugin/require-loading-label.js b/libraries/eslint-plugin/require-loading-label.js index cd3f9b7b0a..62cde70f48 100644 --- a/libraries/eslint-plugin/require-loading-label.js +++ b/libraries/eslint-plugin/require-loading-label.js @@ -3,7 +3,8 @@ module.exports = { type: 'problem', fixable: null, docs: { - description: 'Require loadingLabel prop when isLoading is specified on OLButton', + description: + 'Require loadingLabel prop when isLoading is specified on OLButton', }, schema: [], }, @@ -11,10 +12,7 @@ module.exports = { return { 'JSXOpeningElement[name.name="OLButton"]'(node) { const attributes = new Map( - node.attributes.map(attr => [ - attr.name?.name, - attr - ]) + node.attributes.map(attr => [attr.name?.name, attr]) ) const isLoadingAttr = attributes.get('isLoading') @@ -26,12 +24,13 @@ module.exports = { if ( !isLoadingValue || (isLoadingValue.type === 'JSXExpressionContainer' && - isLoadingValue.expression.type === 'Literal' && - isLoadingValue.expression.value === true) + isLoadingValue.expression.type === 'Literal' && + isLoadingValue.expression.value === true) ) { context.report({ node: isLoadingAttr, - message: 'Button with isLoading prop must also specify loadingLabel', + message: + 'Button with isLoading prop must also specify loadingLabel', }) } else if ( isLoadingValue.type === 'JSXExpressionContainer' && @@ -39,7 +38,8 @@ module.exports = { ) { context.report({ node: isLoadingAttr, - message: 'Button with isLoading prop must also specify loadingLabel', + message: + 'Button with isLoading prop must also specify loadingLabel', }) } } diff --git a/libraries/eslint-plugin/require-vi-doMock-valid-path.js b/libraries/eslint-plugin/require-vi-doMock-valid-path.js index 17e3f8c765..3d2177c4b0 100644 --- a/libraries/eslint-plugin/require-vi-doMock-valid-path.js +++ b/libraries/eslint-plugin/require-vi-doMock-valid-path.js @@ -1,5 +1,5 @@ -const path = require('node:path'); -const fs = require('node:fs'); +const path = require('node:path') +const fs = require('node:fs') module.exports = { meta: { @@ -14,26 +14,39 @@ module.exports = { hasSuggestions: true, schema: [], messages: { - unresolvablePath: 'The path "{{pathValue}}" in vi.doMock() cannot be resolved relative to the current file.', - notAStringLiteral: 'The first argument of vi.doMock() must be (or resolve to) a string literal representing a path.', + unresolvablePath: + 'The path "{{pathValue}}" in vi.doMock() cannot be resolved relative to the current file.', + notAStringLiteral: + 'The first argument of vi.doMock() must be (or resolve to) a string literal representing a path.', noArguments: 'vi.doMock() called with no arguments.', }, }, create(context) { - const currentFilePath = context.getFilename(); + const currentFilePath = context.getFilename() // ESLint can sometimes pass or for snippets not in a file if (currentFilePath === '' || currentFilePath === '') { return {} } - const currentDirectory = path.dirname(currentFilePath); + const currentDirectory = path.dirname(currentFilePath) function canResolve(modulePath) { try { - require.resolve(path.resolve(currentDirectory, modulePath)); - return true; + require.resolve(path.resolve(currentDirectory, modulePath)) + return true } catch (e) { - const absolutePath = path.resolve(currentDirectory, modulePath); - const extensions = ['', '.js', '.mjs', '.ts', '.jsx', '.tsx', '.json', '.node', '/index.js', '/index.ts']; // Add common extensions + const absolutePath = path.resolve(currentDirectory, modulePath) + const extensions = [ + '', + '.js', + '.mjs', + '.ts', + '.jsx', + '.tsx', + '.json', + '.node', + '/index.js', + '/index.ts', + ] // Add common extensions for (const ext of extensions) { if (fs.existsSync(absolutePath + ext)) { return true @@ -63,9 +76,14 @@ module.exports = { const firstArg = node.arguments[0] let pathValue = firstArg.value - if (firstArg.type !== 'Literal' || typeof firstArg.value !== 'string') { + if ( + firstArg.type !== 'Literal' || + typeof firstArg.value !== 'string' + ) { if (firstArg.type === 'Identifier') { - const variable = context.getScope().variables.find(v => v.name === firstArg.name); + const variable = context + .getScope() + .variables.find(v => v.name === firstArg.name) if ( variable && variable.defs.length > 0 && @@ -80,15 +98,13 @@ module.exports = { // If the first argument was a variable that didn't resolve then we can't auto-fix it } } - context.report({ - node: firstArg, - messageId: 'notAStringLiteral', - }) - return - + context.report({ + node: firstArg, + messageId: 'notAStringLiteral', + }) + return } - if (!pathValue.startsWith('.')) { return } @@ -97,12 +113,13 @@ module.exports = { const mjsPath = pathValue.replace('.js', '.mjs') const additionalReportOptions = {} if (canResolve(mjsPath)) { - additionalReportOptions.fix = (fixer) => fixer.replaceText(firstArg, `'${mjsPath}'`) + additionalReportOptions.fix = fixer => + fixer.replaceText(firstArg, `'${mjsPath}'`) additionalReportOptions.suggest = [ { desc: `Replace with "${pathValue.replace('.js', '.mjs')}"`, - fix: (fixer) => fixer.replaceText(firstArg, `'${mjsPath}'`), - } + fix: fixer => fixer.replaceText(firstArg, `'${mjsPath}'`), + }, ] } context.report({ @@ -111,11 +128,11 @@ module.exports = { data: { pathValue, }, - ...additionalReportOptions + ...additionalReportOptions, }) } } }, } }, -}; +} diff --git a/libraries/eslint-plugin/rules.test.js b/libraries/eslint-plugin/rules.test.js index d4f1052415..f7f85f9016 100644 --- a/libraries/eslint-plugin/rules.test.js +++ b/libraries/eslint-plugin/rules.test.js @@ -136,26 +136,33 @@ ruleTester.run('domock-require-valid-path', viDoMockValidPath, { valid: [ { code: 'vi.doMock("./require-vi-doMock-valid-path.js")', - filename: __filename + filename: __filename, }, { code: 'const filename = "./require-vi-doMock-valid-path.js"; vi.doMock(filename);', - filename: __filename - } + filename: __filename, + }, + ], + invalid: [ + { + code: "vi.doMock('./require-vi-doMock-valid-path2')", + filename: __filename, + errors: [ + { + message: + 'The path "./require-vi-doMock-valid-path2" in vi.doMock() cannot be resolved relative to the current file.', + }, + ], + }, + { + code: 'const filename = "./require-vi-doMock-valid-path2.js"; vi.doMock(filename);', + filename: __filename, + errors: [ + { + message: + 'The first argument of vi.doMock() must be (or resolve to) a string literal representing a path.', + }, + ], + }, ], - invalid: [{ - code: "vi.doMock('./require-vi-doMock-valid-path2')", - filename: __filename, - errors: [ - { - message: 'The path "./require-vi-doMock-valid-path2" in vi.doMock() cannot be resolved relative to the current file.'} - ] - }, { - code: 'const filename = "./require-vi-doMock-valid-path2.js"; vi.doMock(filename);', - filename: __filename, - errors: [ - { - message: 'The first argument of vi.doMock() must be (or resolve to) a string literal representing a path.'} - ] - }] }) diff --git a/package-lock.json b/package-lock.json index c2d489e6b7..15c78a0818 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-promise": "^6.0.0", "eslint-plugin-unicorn": "^56.0.0", - "prettier": "3.6.2", + "prettier": "3.7.4", "prettier-plugin-groovy": "0.2.1", "typescript": "^5.9.3" }, @@ -44023,9 +44023,9 @@ } }, "node_modules/prettier": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.4.tgz", + "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 34cc41bdc0..a876d88648 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-promise": "^6.0.0", "eslint-plugin-unicorn": "^56.0.0", - "prettier": "3.6.2", + "prettier": "3.7.4", "prettier-plugin-groovy": "0.2.1", "typescript": "^5.9.3" }, diff --git a/services/history-v1/test/acceptance/js/storage/support/cleanup.js b/services/history-v1/test/acceptance/js/storage/support/cleanup.js index 7612dc71c4..f316b1ebad 100644 --- a/services/history-v1/test/acceptance/js/storage/support/cleanup.js +++ b/services/history-v1/test/acceptance/js/storage/support/cleanup.js @@ -70,9 +70,8 @@ async function cleanupBackup() { // The backupPersistor refuses to delete short prefixes. Use a low-level S3 persistor. if (!s3PersistorForBackupCleanup) { - const { backupPersistor } = await import( - '../../../../../storage/lib/backupPersistor.mjs' - ) + const { backupPersistor } = + await import('../../../../../storage/lib/backupPersistor.mjs') s3PersistorForBackupCleanup = new S3Persistor(backupPersistor.settings) } await Promise.all( diff --git a/services/web/app/src/Features/Authentication/AuthenticationController.mjs b/services/web/app/src/Features/Authentication/AuthenticationController.mjs index 73af8d5058..c84479b25a 100644 --- a/services/web/app/src/Features/Authentication/AuthenticationController.mjs +++ b/services/web/app/src/Features/Authentication/AuthenticationController.mjs @@ -393,9 +393,7 @@ const AuthenticationController = { const middleware = async (req, res, next) => { const Oauth2Server = ( - await import( - '../../../../modules/oauth2-server/app/src/Oauth2Server.mjs' - ) + await import('../../../../modules/oauth2-server/app/src/Oauth2Server.mjs') ).default const request = new Oauth2Server.Request(req) diff --git a/services/web/app/src/Features/Authentication/AuthenticationErrors.mjs b/services/web/app/src/Features/Authentication/AuthenticationErrors.mjs index dc1d0cbd8d..1fb661be5b 100644 --- a/services/web/app/src/Features/Authentication/AuthenticationErrors.mjs +++ b/services/web/app/src/Features/Authentication/AuthenticationErrors.mjs @@ -6,7 +6,8 @@ import Errors from '../Errors/Errors.js' export class InvalidEmailError extends Errors.BackwardCompatibleError {} export class InvalidPasswordError extends Errors.BackwardCompatibleError {} export class ParallelLoginError extends Errors.BackwardCompatibleError {} -export class PasswordMustBeDifferentError extends Errors.BackwardCompatibleError {} +export class PasswordMustBeDifferentError + extends Errors.BackwardCompatibleError {} export class PasswordReusedError extends Errors.BackwardCompatibleError {} export function handleAuthenticateErrors(error, req) { diff --git a/services/web/app/src/Features/Project/ProjectListController.mjs b/services/web/app/src/Features/Project/ProjectListController.mjs index c1f418406d..60bb51d57d 100644 --- a/services/web/app/src/Features/Project/ProjectListController.mjs +++ b/services/web/app/src/Features/Project/ProjectListController.mjs @@ -876,12 +876,12 @@ function _matchesFilters(project, tags, filters) { function _hasActiveFilter(filters) { return Boolean( filters.ownedByUser || - filters.sharedWithUser || - filters.archived || - filters.trashed || - filters.tag === null || - filters.tag?.length || - filters.search?.length + filters.sharedWithUser || + filters.archived || + filters.trashed || + filters.tag === null || + filters.tag?.length || + filters.search?.length ) } diff --git a/services/web/app/src/Features/Subscription/AiHelper.mjs b/services/web/app/src/Features/Subscription/AiHelper.mjs index 37a1a2e4a7..0676c2f420 100644 --- a/services/web/app/src/Features/Subscription/AiHelper.mjs +++ b/services/web/app/src/Features/Subscription/AiHelper.mjs @@ -31,9 +31,7 @@ export function isStandaloneAiAddOnPlanCode(planCode) { export function subscriptionChangeIsAiAssistUpgrade(subscriptionChange) { return Boolean( isStandaloneAiAddOnPlanCode(subscriptionChange.nextPlanCode) || - subscriptionChange.nextAddOns?.some( - addOn => addOn.code === AI_ADD_ON_CODE - ) + subscriptionChange.nextAddOns?.some(addOn => addOn.code === AI_ADD_ON_CODE) ) } diff --git a/services/web/app/src/Features/Subscription/PlansHelper.mjs b/services/web/app/src/Features/Subscription/PlansHelper.mjs index 79ca9672a3..fa310a9316 100644 --- a/services/web/app/src/Features/Subscription/PlansHelper.mjs +++ b/services/web/app/src/Features/Subscription/PlansHelper.mjs @@ -6,7 +6,7 @@ export function isProfessionalPlan(planCode) { // only identify "modern" professional group plans as eligible, and do not include legacy plans return Boolean( planCode?.includes('professional') && - FeaturesHelper.getMatchedFeatureSet(plan?.features) === 'professional' + FeaturesHelper.getMatchedFeatureSet(plan?.features) === 'professional' ) } diff --git a/services/web/app/src/Features/Subscription/SubscriptionLocator.mjs b/services/web/app/src/Features/Subscription/SubscriptionLocator.mjs index 172f5ea74a..9950162955 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionLocator.mjs +++ b/services/web/app/src/Features/Subscription/SubscriptionLocator.mjs @@ -171,7 +171,7 @@ const SubscriptionLocator = { return Boolean( (subscription?.planCode && isStandaloneAiAddOnPlanCode(subscription?.planCode)) || - subscription?.addOns?.some(addOn => addOn.addOnCode === AI_ADD_ON_CODE) + subscription?.addOns?.some(addOn => addOn.addOnCode === AI_ADD_ON_CODE) ) }, diff --git a/services/web/app/src/Features/UserMembership/UserMembershipController.mjs b/services/web/app/src/Features/UserMembership/UserMembershipController.mjs index b6c59bdee6..c204fee93b 100644 --- a/services/web/app/src/Features/UserMembership/UserMembershipController.mjs +++ b/services/web/app/src/Features/UserMembership/UserMembershipController.mjs @@ -59,9 +59,9 @@ async function manageGroupMembers(req, res, next) { const canUseAddSeatsFeature = Boolean( plan?.canUseFlexibleLicensing && - isAdmin && - recurlySubscription && - !recurlySubscription.pendingChange + isAdmin && + recurlySubscription && + !recurlySubscription.pendingChange ) res.render('user_membership/group-members-react', { diff --git a/services/web/app/src/infrastructure/Features.mjs b/services/web/app/src/infrastructure/Features.mjs index 6a398a60c1..f887457cce 100644 --- a/services/web/app/src/infrastructure/Features.mjs +++ b/services/web/app/src/infrastructure/Features.mjs @@ -85,7 +85,7 @@ const Features = { case 'link-url': return Boolean( _.get(Settings, ['apis', 'linkedUrlProxy', 'url']) && - Settings.enabledLinkedFileTypes.includes('url') + Settings.enabledLinkedFileTypes.includes('url') ) case 'support': return supportModuleAvailable diff --git a/services/web/frontend/js/features/cookie-banner/utils.ts b/services/web/frontend/js/features/cookie-banner/utils.ts index 5c045d4e71..8438eba55b 100644 --- a/services/web/frontend/js/features/cookie-banner/utils.ts +++ b/services/web/frontend/js/features/cookie-banner/utils.ts @@ -32,9 +32,9 @@ export function cookieBannerRequired() { const exposedSettings = getMeta('ol-ExposedSettings') return Boolean( exposedSettings.gaToken || - exposedSettings.gaTokenV4 || - exposedSettings.propensityId || - exposedSettings.hotjarId + exposedSettings.gaTokenV4 || + exposedSettings.propensityId || + exposedSettings.hotjarId ) } diff --git a/services/web/frontend/js/features/file-view/components/file-view-pdf.tsx b/services/web/frontend/js/features/file-view/components/file-view-pdf.tsx index d23c412c7a..6d4fabde15 100644 --- a/services/web/frontend/js/features/file-view/components/file-view-pdf.tsx +++ b/services/web/frontend/js/features/file-view/components/file-view-pdf.tsx @@ -14,9 +14,8 @@ const FileViewPdf: FC<{ const handleContainer = useCallback( async (element: HTMLDivElement | null) => { if (element) { - const { loadPdfDocumentFromUrl } = await import( - '@/features/pdf-preview/util/pdf-js' - ) + const { loadPdfDocumentFromUrl } = + await import('@/features/pdf-preview/util/pdf-js') // bail out if loading PDF.js took too long if (!mountedRef.current) { diff --git a/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx b/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx index c7be4acc4e..8db7d3cd95 100644 --- a/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx +++ b/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx @@ -42,8 +42,7 @@ export interface GotoOffsetOptions { } interface OpenDocOptions - extends Partial, - Partial { + extends Partial, Partial { gotoOffset?: number forceReopen?: boolean keepCurrentView?: boolean diff --git a/services/web/frontend/js/features/ide-react/types/file-tree.ts b/services/web/frontend/js/features/ide-react/types/file-tree.ts index 648ed99a25..64217314c5 100644 --- a/services/web/frontend/js/features/ide-react/types/file-tree.ts +++ b/services/web/frontend/js/features/ide-react/types/file-tree.ts @@ -13,18 +13,15 @@ interface BaseFileTreeFindResult { index: number } -export interface FileTreeFolderFindResult - extends BaseFileTreeFindResult { +export interface FileTreeFolderFindResult extends BaseFileTreeFindResult { type: 'folder' } -export interface FileTreeDocumentFindResult - extends BaseFileTreeFindResult { +export interface FileTreeDocumentFindResult extends BaseFileTreeFindResult { type: 'doc' } -export interface FileTreeFileRefFindResult - extends BaseFileTreeFindResult { +export interface FileTreeFileRefFindResult extends BaseFileTreeFindResult { type: 'fileRef' } diff --git a/services/web/frontend/js/features/project-list/components/modals/manage-tag-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/manage-tag-modal.tsx index 37b095d3b8..06eb5add94 100644 --- a/services/web/frontend/js/features/project-list/components/modals/manage-tag-modal.tsx +++ b/services/web/frontend/js/features/project-list/components/modals/manage-tag-modal.tsx @@ -144,9 +144,9 @@ export function ManageTagModal({ onClick={() => runUpdateTag(tag._id)} disabled={Boolean( isUpdateLoading || - isDeleteLoading || - !newTagName?.length || - (newTagName === tag?.name && selectedColor === getTagColor(tag)) + isDeleteLoading || + !newTagName?.length || + (newTagName === tag?.name && selectedColor === getTagColor(tag)) )} isLoading={isUpdateLoading} loadingLabel={t('saving')} diff --git a/services/web/frontend/js/features/settings/components/emails/actions/make-primary/make-primary.tsx b/services/web/frontend/js/features/settings/components/emails/actions/make-primary/make-primary.tsx index de53c2299b..c0cb61288a 100644 --- a/services/web/frontend/js/features/settings/components/emails/actions/make-primary/make-primary.tsx +++ b/services/web/frontend/js/features/settings/components/emails/actions/make-primary/make-primary.tsx @@ -86,8 +86,8 @@ function MakePrimary({ const isConfirmDisabled = Boolean( !userEmailData.confirmedAt || - state.isLoading || - inReconfirmNotificationPeriod(userEmailData) + state.isLoading || + inReconfirmNotificationPeriod(userEmailData) ) return ( diff --git a/services/web/frontend/js/features/settings/components/emails/row.tsx b/services/web/frontend/js/features/settings/components/emails/row.tsx index 167f9f6b66..c3c982d533 100644 --- a/services/web/frontend/js/features/settings/components/emails/row.tsx +++ b/services/web/frontend/js/features/settings/components/emails/row.tsx @@ -23,7 +23,7 @@ type EmailsRowProps = { function EmailsRow({ userEmailData, primary }: EmailsRowProps) { const hasSSOAffiliation = Boolean( userEmailData.affiliation && - ssoAvailableForInstitution(userEmailData.affiliation.institution) + ssoAvailableForInstitution(userEmailData.affiliation.institution) ) return ( diff --git a/services/web/frontend/js/features/share-project-modal/components/share-modal-body.tsx b/services/web/frontend/js/features/share-project-modal/components/share-modal-body.tsx index c12ad1d2a5..4f74d1d5b5 100644 --- a/services/web/frontend/js/features/share-project-modal/components/share-modal-body.tsx +++ b/services/web/frontend/js/features/share-project-modal/components/share-modal-body.tsx @@ -45,7 +45,7 @@ export default function ShareModalBody() { members?.some(member => ['readAndWrite', 'review'].includes(member.privileges) ) && - members?.some(member => member.pendingEditor || member.pendingReviewer) + members?.some(member => member.pendingEditor || member.pendingReviewer) ) }, [members]) diff --git a/services/web/frontend/js/features/source-editor/components/table-generator/cell-input.tsx b/services/web/frontend/js/features/source-editor/components/table-generator/cell-input.tsx index 461b299822..2afe076e61 100644 --- a/services/web/frontend/js/features/source-editor/components/table-generator/cell-input.tsx +++ b/services/web/frontend/js/features/source-editor/components/table-generator/cell-input.tsx @@ -1,7 +1,6 @@ import { forwardRef, useImperativeHandle, useLayoutEffect, useRef } from 'react' -interface CellInputProps - extends React.TextareaHTMLAttributes { +interface CellInputProps extends React.TextareaHTMLAttributes { value: string } diff --git a/services/web/frontend/js/features/source-editor/extensions/bracket-matching.ts b/services/web/frontend/js/features/source-editor/extensions/bracket-matching.ts index c14b144e6e..840bb7687a 100644 --- a/services/web/frontend/js/features/source-editor/extensions/bracket-matching.ts +++ b/services/web/frontend/js/features/source-editor/extensions/bracket-matching.ts @@ -61,8 +61,8 @@ interface AdjacentMatchResult extends MatchResult { const matchedAdjacent = (match: MatchResult): match is AdjacentMatchResult => Boolean( match.matched && - match.end && - (match.start.to === match.end.from || match.end.to === match.start.from) + match.end && + (match.start.to === match.end.from || match.end.to === match.start.from) ) /** diff --git a/services/web/frontend/js/features/source-editor/extensions/visual/atomic-decorations.ts b/services/web/frontend/js/features/source-editor/extensions/visual/atomic-decorations.ts index cdedab31b4..31c261fe59 100644 --- a/services/web/frontend/js/features/source-editor/extensions/visual/atomic-decorations.ts +++ b/services/web/frontend/js/features/source-editor/extensions/visual/atomic-decorations.ts @@ -922,7 +922,7 @@ export const atomicDecorations = (options: Options) => { ) const centered = Boolean( environmentNode && - centeringNodeForEnvironment(environmentNode) + centeringNodeForEnvironment(environmentNode) ) const figureData = environmentNode ? parseFigureData(environmentNode, state) diff --git a/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/graphics.ts b/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/graphics.ts index 64972af967..4b5f22362a 100644 --- a/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/graphics.ts +++ b/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/graphics.ts @@ -241,9 +241,8 @@ export class GraphicsWidget extends WidgetType { } async renderPDF(view: EditorView, canvas: HTMLCanvasElement, url: string) { - const { loadPdfDocumentFromUrl } = await import( - '@/features/pdf-preview/util/pdf-js' - ) + const { loadPdfDocumentFromUrl } = + await import('@/features/pdf-preview/util/pdf-js') // bail out if loading PDF.js took too long if (this.destroyed) { diff --git a/services/web/frontend/js/features/source-editor/utils/layer.ts b/services/web/frontend/js/features/source-editor/utils/layer.ts index 7f3bbc8701..a26e860a9c 100644 --- a/services/web/frontend/js/features/source-editor/utils/layer.ts +++ b/services/web/frontend/js/features/source-editor/utils/layer.ts @@ -271,7 +271,6 @@ function rectanglesForRange( for ( let pos = Math.max(r.from, start), endPos = Math.min(r.to, end); ; - ) { const docLine = view.state.doc.lineAt(pos) for (const span of view.bidiSpans(docLine)) { diff --git a/services/web/frontend/js/features/subscription/components/dashboard/states/active/active.tsx b/services/web/frontend/js/features/subscription/components/dashboard/states/active/active.tsx index 414fad677c..034162d368 100644 --- a/services/web/frontend/js/features/subscription/components/dashboard/states/active/active.tsx +++ b/services/web/frontend/js/features/subscription/components/dashboard/states/active/active.tsx @@ -85,8 +85,8 @@ export function ActiveSubscription({ const hasPendingPause = Boolean( subscription.payment.state === 'active' && - subscription.payment.remainingPauseCycles && - subscription.payment.remainingPauseCycles > 0 + subscription.payment.remainingPauseCycles && + subscription.payment.remainingPauseCycles > 0 ) const isLegacyPlan = diff --git a/services/web/frontend/js/features/subscription/context/subscription-dashboard-context.tsx b/services/web/frontend/js/features/subscription/context/subscription-dashboard-context.tsx index 0dda7dce89..a06614ccce 100644 --- a/services/web/frontend/js/features/subscription/context/subscription-dashboard-context.tsx +++ b/services/web/frontend/js/features/subscription/context/subscription-dashboard-context.tsx @@ -129,17 +129,17 @@ export function SubscriptionDashboardProvider({ const hasDisplayedSubscription = Boolean( institutionMemberships?.length > 0 || - personalSubscription || - memberGroupSubscriptions?.length > 0 || - managedGroupSubscriptions?.length > 0 || - managedInstitutions?.length > 0 || - managedPublishers?.length > 0 + personalSubscription || + memberGroupSubscriptions?.length > 0 || + managedGroupSubscriptions?.length > 0 || + managedInstitutions?.length > 0 || + managedPublishers?.length > 0 ) const hasValidActiveSubscription = Boolean( ['active', 'canceled'].includes(personalSubscription?.payment?.state) || - institutionMemberships?.length > 0 || - memberGroupSubscriptions?.length > 0 + institutionMemberships?.length > 0 || + memberGroupSubscriptions?.length > 0 ) const getFormattedRenewalDate = useCallback(() => { diff --git a/services/web/frontend/js/infrastructure/error-reporter.ts b/services/web/frontend/js/infrastructure/error-reporter.ts index 8a8c1767da..6b7bb0f0a4 100644 --- a/services/web/frontend/js/infrastructure/error-reporter.ts +++ b/services/web/frontend/js/infrastructure/error-reporter.ts @@ -58,10 +58,10 @@ const isPropensityNetworkError = (err: ErrorEvent) => { const breadcrumbUrl = errorBreadcrumbs[0]?.data?.url return Boolean( breadcrumbUrl && - [ - 'https://analytics.propensity.com/', - 'https://analytics.propensity-abm.com/', - ].some(url => breadcrumbUrl.startsWith(url)) + [ + 'https://analytics.propensity.com/', + 'https://analytics.propensity-abm.com/', + ].some(url => breadcrumbUrl.startsWith(url)) ) } diff --git a/services/web/frontend/js/shared/components/recaptcha-2.tsx b/services/web/frontend/js/shared/components/recaptcha-2.tsx index edca1532fd..49b4728100 100644 --- a/services/web/frontend/js/shared/components/recaptcha-2.tsx +++ b/services/web/frontend/js/shared/components/recaptcha-2.tsx @@ -2,8 +2,10 @@ import ReCAPTCHA from 'react-google-recaptcha' import getMeta from '@/utils/meta' import { ExposedSettings } from '../../../../types/exposed-settings' -interface ReCaptcha2Props - extends Pick, 'onChange'> { +interface ReCaptcha2Props extends Pick< + React.ComponentProps, + 'onChange' +> { page: keyof ExposedSettings['recaptchaDisabled'] recaptchaRef: React.LegacyRef } diff --git a/services/web/frontend/js/shared/context/editor-context.tsx b/services/web/frontend/js/shared/context/editor-context.tsx index d3d56fe64a..96f87fe1a1 100644 --- a/services/web/frontend/js/shared/context/editor-context.tsx +++ b/services/web/frontend/js/shared/context/editor-context.tsx @@ -84,7 +84,7 @@ export const EditorProvider: FC = ({ children }) => { () => { return Boolean( featureUsage?.aiErrorAssistant && - featureUsage?.aiErrorAssistant.remainingUsage > 0 + featureUsage?.aiErrorAssistant.remainingUsage > 0 ) } ) diff --git a/services/web/test/unit/src/Analytics/EmailChangeHelpers.test.mjs b/services/web/test/unit/src/Analytics/EmailChangeHelpers.test.mjs index bf414139ae..9269c2fed5 100644 --- a/services/web/test/unit/src/Analytics/EmailChangeHelpers.test.mjs +++ b/services/web/test/unit/src/Analytics/EmailChangeHelpers.test.mjs @@ -29,9 +29,7 @@ describe('EmailChangeHelper', function () { ) EmailChangeHelpers = ( - await import( - '../../../../app/src/Features/Analytics/EmailChangeHelper.mjs' - ) + await import('../../../../app/src/Features/Analytics/EmailChangeHelper.mjs') ).default }) diff --git a/services/web/types/project/dashboard/notification.ts b/services/web/types/project/dashboard/notification.ts index 4aa0da5a7d..2db8e12432 100644 --- a/services/web/types/project/dashboard/notification.ts +++ b/services/web/types/project/dashboard/notification.ts @@ -46,8 +46,7 @@ export interface NotificationTPDSFileLimit extends NotificationBase { } } -export interface NotificationDropboxDuplicateProjectNames - extends NotificationBase { +export interface NotificationDropboxDuplicateProjectNames extends NotificationBase { templateKey: Extract< TemplateKey, 'notification_dropbox_duplicate_project_names' @@ -57,8 +56,7 @@ export interface NotificationDropboxDuplicateProjectNames } } -interface NotificationDropboxUnlinkedDueToLapsedReconfirmation - extends NotificationBase { +interface NotificationDropboxUnlinkedDueToLapsedReconfirmation extends NotificationBase { templateKey: Extract< TemplateKey, 'notification_dropbox_unlinked_due_to_lapsed_reconfirmation' diff --git a/services/web/types/recurly/pricing/subscription.ts b/services/web/types/recurly/pricing/subscription.ts index 78b761fd61..66bc32cfd8 100644 --- a/services/web/types/recurly/pricing/subscription.ts +++ b/services/web/types/recurly/pricing/subscription.ts @@ -55,8 +55,7 @@ interface AddOn { // Extending the default interface as it lacks the `items` prop export interface SubscriptionPricingInstanceCustom - extends SubscriptionPricingInstance, - SubscriptionPricingState { + extends SubscriptionPricingInstance, SubscriptionPricingState { id: string items: { addons: AddOn[] diff --git a/services/web/types/review-panel/comment-thread.ts b/services/web/types/review-panel/comment-thread.ts index da59bdee22..7c870408ea 100644 --- a/services/web/types/review-panel/comment-thread.ts +++ b/services/web/types/review-panel/comment-thread.ts @@ -10,16 +10,14 @@ export interface ReviewPanelCommentThreadBase { submitting?: boolean // angular specific (to be made into a local state) } -interface ReviewPanelUnresolvedCommentThread - extends ReviewPanelCommentThreadBase { +interface ReviewPanelUnresolvedCommentThread extends ReviewPanelCommentThreadBase { resolved?: never resolved_at?: never resolved_by_user_id?: never resolved_by_user?: never } -export interface ReviewPanelResolvedCommentThread - extends ReviewPanelCommentThreadBase { +export interface ReviewPanelResolvedCommentThread extends ReviewPanelCommentThreadBase { resolved: boolean resolved_at: DateString resolved_by_user_id: UserId