diff --git a/services/web/frontend/js/features/history/components/change-list/dropdown/history-dropdown-content.tsx b/services/web/frontend/js/features/history/components/change-list/dropdown/history-dropdown-content.tsx index ac7a0044d8..43858f7eb3 100644 --- a/services/web/frontend/js/features/history/components/change-list/dropdown/history-dropdown-content.tsx +++ b/services/web/frontend/js/features/history/components/change-list/dropdown/history-dropdown-content.tsx @@ -28,11 +28,7 @@ function HistoryDropdownContent({ return ( <> {permissions.labelVersion && ( - + )} void } -function AddLabel({ - version, - projectId, - closeDropdown, - ...props -}: DownloadProps) { +function AddLabel({ version, closeDropdown, ...props }: AddLabelProps) { const { t } = useTranslation() const [showModal, setShowModal] = useState(false) diff --git a/services/web/frontend/js/features/history/extensions/highlights.ts b/services/web/frontend/js/features/history/extensions/highlights.ts index ce274cf724..1f81f82e74 100644 --- a/services/web/frontend/js/features/history/extensions/highlights.ts +++ b/services/web/frontend/js/features/history/extensions/highlights.ts @@ -238,7 +238,7 @@ class EmptyLineAdditionMarkerWidget extends WidgetType { super() } - toDOM(view: EditorView): HTMLElement { + toDOM(): HTMLElement { const element = document.createElement('span') element.classList.add( 'ol-cm-empty-line-addition-marker', @@ -255,7 +255,7 @@ class EmptyLineDeletionMarkerWidget extends WidgetType { super() } - toDOM(view: EditorView): HTMLElement { + toDOM(): HTMLElement { const element = document.createElement('span') element.classList.add( 'ol-cm-empty-line-deletion-marker', @@ -297,7 +297,7 @@ class ChangeGutterMarker extends GutterMarker { super() } - toDOM(view: EditorView) { + toDOM() { const el = document.createElement('div') el.className = 'ol-cm-changed-line-gutter' el.style.setProperty('--hue', this.hue.toString()) diff --git a/services/web/frontend/js/features/ide-react/editor/document-container.ts b/services/web/frontend/js/features/ide-react/editor/document-container.ts index 2ded041fb1..28bcb955d1 100644 --- a/services/web/frontend/js/features/ide-react/editor/document-container.ts +++ b/services/web/frontend/js/features/ide-react/editor/document-container.ts @@ -599,7 +599,7 @@ export class DocumentContainer extends EventEmitter { this.doc.on('remoteop', (...ops: AnyOperation[]) => { return this.trigger('remoteop', ...ops) }) - this.doc.on('op:sent', (op: AnyOperation) => { + this.doc.on('op:sent', () => { return this.trigger('op:sent') }) this.doc.on('op:acknowledged', (op: AnyOperation) => { @@ -609,7 +609,7 @@ export class DocumentContainer extends EventEmitter { }) return this.trigger('op:acknowledged') }) - this.doc.on('op:timeout', (op: AnyOperation) => { + this.doc.on('op:timeout', () => { this.trigger('op:timeout') return this.onError(new Error('op timed out')) }) diff --git a/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/tags-dropdown.tsx b/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/tags-dropdown.tsx index 443962cc3c..06dd9b8ff3 100644 --- a/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/tags-dropdown.tsx +++ b/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/tags-dropdown.tsx @@ -91,7 +91,7 @@ function TagsDropdown() { data-testid="project-tools-more-dropdown-menu" > {t('add_to_tag')} - {sortBy(tags, tag => tag.name?.toLowerCase()).map((tag, index) => ( + {sortBy(tags, tag => tag.name?.toLowerCase()).map(tag => (
  • diff --git a/services/web/frontend/js/features/review-panel-new/components/review-panel.tsx b/services/web/frontend/js/features/review-panel-new/components/review-panel.tsx index 7d8b694f68..74405ba276 100644 --- a/services/web/frontend/js/features/review-panel-new/components/review-panel.tsx +++ b/services/web/frontend/js/features/review-panel-new/components/review-panel.tsx @@ -17,7 +17,7 @@ const ReviewPanel: FC<{ mini?: boolean }> = ({ mini = false }) => { [choosenSubView, mini] ) - const style = useReviewPanelStyles(mini) + const style = useReviewPanelStyles() const className = classnames('review-panel-container', { 'review-panel-mini': mini, diff --git a/services/web/frontend/js/features/review-panel-new/hooks/use-review-panel-styles.ts b/services/web/frontend/js/features/review-panel-new/hooks/use-review-panel-styles.ts index 7e7dda1850..727701ccc3 100644 --- a/services/web/frontend/js/features/review-panel-new/hooks/use-review-panel-styles.ts +++ b/services/web/frontend/js/features/review-panel-new/hooks/use-review-panel-styles.ts @@ -1,7 +1,7 @@ import { CSSProperties, useCallback, useEffect, useState } from 'react' import { useCodeMirrorViewContext } from '@/features/source-editor/components/codemirror-context' -export const useReviewPanelStyles = (mini: boolean) => { +export const useReviewPanelStyles = () => { const view = useCodeMirrorViewContext() const [styles, setStyles] = useState({ diff --git a/services/web/frontend/js/features/source-editor/components/table-generator/toolbar/commands.ts b/services/web/frontend/js/features/source-editor/components/table-generator/toolbar/commands.ts index 2645e853bd..ab58179586 100644 --- a/services/web/frontend/js/features/source-editor/components/table-generator/toolbar/commands.ts +++ b/services/web/frontend/js/features/source-editor/components/table-generator/toolbar/commands.ts @@ -45,16 +45,16 @@ const themeGenerators: Record = { left: true, right: number === numColumns - 1, }), - row: (number: number, numRows: number) => '\\hline', + row: () => '\\hline', multicolumn: () => ({ left: true, right: true }), lastRow: () => '\\hline', }, [BorderTheme.BOOKTABS]: { - column: (number: number, numColumns: number) => ({ + column: () => ({ left: false, right: false, }), - row: (number: number, numRows: number) => { + row: (number: number) => { if (number === 0) { return '\\toprule' } diff --git a/services/web/frontend/js/features/source-editor/extensions/cursor-highlights.ts b/services/web/frontend/js/features/source-editor/extensions/cursor-highlights.ts index 78d2903825..ccdc8b90e7 100644 --- a/services/web/frontend/js/features/source-editor/extensions/cursor-highlights.ts +++ b/services/web/frontend/js/features/source-editor/extensions/cursor-highlights.ts @@ -187,7 +187,7 @@ class CursorMarker extends RectangleMarker { const cursorHighlightsLayer = layer({ above: true, class: 'ol-cm-cursorHighlightsLayer', - update: (update, layer) => { + update: update => { return ( update.docChanged || update.selectionSet || diff --git a/services/web/frontend/js/features/source-editor/extensions/cursor-position.ts b/services/web/frontend/js/features/source-editor/extensions/cursor-position.ts index efde64f40e..0cd69d8b1f 100644 --- a/services/web/frontend/js/features/source-editor/extensions/cursor-position.ts +++ b/services/web/frontend/js/features/source-editor/extensions/cursor-position.ts @@ -42,7 +42,7 @@ export const cursorPosition = ({ // Asynchronously dispatch cursor position when the selection changes and // provide a little debouncing. Using requestAnimationFrame postpones it // until the next CM6 DOM update. - ViewPlugin.define(view => { + ViewPlugin.define(() => { let animationFrameRequest: number | null = null return { diff --git a/services/web/frontend/js/features/source-editor/extensions/draw-selection.ts b/services/web/frontend/js/features/source-editor/extensions/draw-selection.ts index af31353a23..413317ec0a 100644 --- a/services/web/frontend/js/features/source-editor/extensions/draw-selection.ts +++ b/services/web/frontend/js/features/source-editor/extensions/draw-selection.ts @@ -71,7 +71,7 @@ const cursorLayer = layer({ updateHasMouseDownEffect(update) ) }, - mount(dom, view) { + mount(dom) { dom.style.animationDuration = '1200ms' }, class: 'cm-cursorLayer', @@ -90,7 +90,7 @@ const selectionLayer = layer({ } return markers }, - update(update, dom) { + update(update) { return ( update.docChanged || update.selectionSet || diff --git a/services/web/frontend/js/features/source-editor/extensions/empty-line-filler.ts b/services/web/frontend/js/features/source-editor/extensions/empty-line-filler.ts index 647463d608..49d9b195b9 100644 --- a/services/web/frontend/js/features/source-editor/extensions/empty-line-filler.ts +++ b/services/web/frontend/js/features/source-editor/extensions/empty-line-filler.ts @@ -9,13 +9,13 @@ import { import browser from './browser' class EmptyLineWidget extends WidgetType { - toDOM(view: EditorView): HTMLElement { + toDOM(): HTMLElement { const element = document.createElement('span') element.className = 'ol-cm-filler' return element } - eq(widget: EmptyLineWidget) { + eq() { return true } } diff --git a/services/web/frontend/js/features/source-editor/extensions/keybindings.ts b/services/web/frontend/js/features/source-editor/extensions/keybindings.ts index 3e67b4b753..01c39d67ba 100644 --- a/services/web/frontend/js/features/source-editor/extensions/keybindings.ts +++ b/services/web/frontend/js/features/source-editor/extensions/keybindings.ts @@ -34,17 +34,14 @@ const customiseVimOnce = (_Vim: typeof Vim, _CodeMirror: typeof CodeMirror) => { // Allow copy via Ctrl-C in insert mode _Vim.unmap('', 'insert') - _Vim.defineAction( - 'insertModeCtrlC', - (cm: CodeMirror, actionArgs: object, state: any) => { - if (hasNonEmptySelection(cm)) { - navigator.clipboard.writeText(cm.getSelection()) - cm.setSelection(cm.getCursor(), cm.getCursor()) - } else { - _Vim.exitInsertMode(cm) - } + _Vim.defineAction('insertModeCtrlC', (cm: CodeMirror) => { + if (hasNonEmptySelection(cm)) { + navigator.clipboard.writeText(cm.getSelection()) + cm.setSelection(cm.getCursor(), cm.getCursor()) + } else { + _Vim.exitInsertMode(cm) } - ) + }) // Overwrite the moveByCharacters command with a decoration-aware version _Vim.defineMotion( diff --git a/services/web/frontend/js/features/source-editor/extensions/ranges.ts b/services/web/frontend/js/features/source-editor/extensions/ranges.ts index 8dc4489d57..7bde7a4adb 100644 --- a/services/web/frontend/js/features/source-editor/extensions/ranges.ts +++ b/services/web/frontend/js/features/source-editor/extensions/ranges.ts @@ -68,7 +68,7 @@ export const rangesDataField = StateField.define({ export const ranges = () => [ rangesDataField, // handle viewportChanged updates - ViewPlugin.define(view => { + ViewPlugin.define(() => { let timer: number return { diff --git a/services/web/frontend/js/features/source-editor/extensions/realtime.ts b/services/web/frontend/js/features/source-editor/extensions/realtime.ts index e9f5710338..58cfa8712a 100644 --- a/services/web/frontend/js/features/source-editor/extensions/realtime.ts +++ b/services/web/frontend/js/features/source-editor/extensions/realtime.ts @@ -334,10 +334,7 @@ class HistoryOTAdapter { } } - handleUpdateFromCM( - transactions: readonly Transaction[], - ranges?: RangesTracker - ) { + handleUpdateFromCM(transactions: readonly Transaction[]) { for (const transaction of transactions) { if ( this.maxDocLength && diff --git a/services/web/frontend/js/features/source-editor/extensions/vertical-overflow.ts b/services/web/frontend/js/features/source-editor/extensions/vertical-overflow.ts index 20505ed95d..873343c2bc 100644 --- a/services/web/frontend/js/features/source-editor/extensions/vertical-overflow.ts +++ b/services/web/frontend/js/features/source-editor/extensions/vertical-overflow.ts @@ -188,7 +188,7 @@ class TopPaddingWidget extends WidgetType { this.height = height } - toDOM(view: EditorView): HTMLElement { + toDOM(): HTMLElement { const element = document.createElement('div') element.style.height = this.height + 'px' return element diff --git a/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/end.ts b/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/end.ts index 232399de3b..3ca2439ae1 100644 --- a/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/end.ts +++ b/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/end.ts @@ -7,7 +7,7 @@ export class EndWidget extends WidgetType { return element } - eq(widget: EndWidget) { + eq() { return true } diff --git a/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/environment-line.ts b/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/environment-line.ts index d6ab42503e..d506ac2c38 100644 --- a/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/environment-line.ts +++ b/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/environment-line.ts @@ -1,4 +1,4 @@ -import { EditorView, WidgetType } from '@codemirror/view' +import { WidgetType } from '@codemirror/view' export class EnvironmentLineWidget extends WidgetType { constructor( @@ -8,7 +8,7 @@ export class EnvironmentLineWidget extends WidgetType { super() } - toDOM(view: EditorView) { + toDOM() { const element = document.createElement('div') element.classList.add(`ol-cm-environment-${this.environment}`) element.classList.add('ol-cm-environment-edge') diff --git a/services/web/frontend/js/features/source-editor/languages/latex/latex-indent-service.ts b/services/web/frontend/js/features/source-editor/languages/latex/latex-indent-service.ts index 08c1798032..d1e8e84bc4 100644 --- a/services/web/frontend/js/features/source-editor/languages/latex/latex-indent-service.ts +++ b/services/web/frontend/js/features/source-editor/languages/latex/latex-indent-service.ts @@ -1,7 +1,7 @@ import { indentService } from '@codemirror/language' export const latexIndentService = () => - indentService.of((indentContext, pos) => { + indentService.of(indentContext => { // only use this for insertNewLineAndIndent if (indentContext.simulatedBreak) { // match the indentation of the previous line (if present) diff --git a/services/web/frontend/js/features/subscription/components/dashboard/states/active/change-plan/individual-plans-table.tsx b/services/web/frontend/js/features/subscription/components/dashboard/states/active/change-plan/individual-plans-table.tsx index a6ede01715..d8c98fc56b 100644 --- a/services/web/frontend/js/features/subscription/components/dashboard/states/active/change-plan/individual-plans-table.tsx +++ b/services/web/frontend/js/features/subscription/components/dashboard/states/active/change-plan/individual-plans-table.tsx @@ -20,7 +20,7 @@ function ChangeToPlanButton({ planCode }: { planCode: string }) { ) } -function KeepCurrentPlanButton({ plan }: { plan: Plan }) { +function KeepCurrentPlanButton() { const { t } = useTranslation() const { handleOpenModal } = useSubscriptionDashboardContext() @@ -43,7 +43,7 @@ function ChangePlanButton({ plan }: { plan: Plan }) { plan.planCode === personalSubscription.planCode.split('_')[0] if (isCurrentPlanForUser && personalSubscription.pendingPlan) { - return + return } else if (isCurrentPlanForUser && !personalSubscription.pendingPlan) { return ( diff --git a/services/web/frontend/stories/decorators/scope.tsx b/services/web/frontend/stories/decorators/scope.tsx index e69ebd8d21..ae6e366eb8 100644 --- a/services/web/frontend/stories/decorators/scope.tsx +++ b/services/web/frontend/stories/decorators/scope.tsx @@ -72,7 +72,7 @@ const initialize = () => { } }, 0) }, - $on: (eventName: string, callback: () => void) => { + $on: () => { // }, $broadcast: () => {}, diff --git a/services/web/frontend/stories/fixtures/compile.js b/services/web/frontend/stories/fixtures/compile.js index 9471ff04ff..bc7ebfae8b 100644 --- a/services/web/frontend/stories/fixtures/compile.js +++ b/services/web/frontend/stories/fixtures/compile.js @@ -100,7 +100,7 @@ export const mockClearCache = fetchMock => }) export const mockBuildFile = fetchMock => - fetchMock.get('express:/build/:file', (url, options, request) => { + fetchMock.get('express:/build/:file', url => { const { pathname } = new URL(url, 'https://example.com') switch (pathname) { @@ -190,7 +190,7 @@ export const mockEventTracking = fetchMock => fetchMock.get('express:/event/:event', 204) export const mockValidPdf = fetchMock => - fetchMock.get('express:/build/output.pdf', (url, options, request) => { + fetchMock.get('express:/build/output.pdf', () => { return new Promise(resolve => { const xhr = new XMLHttpRequest() xhr.addEventListener('load', () => { diff --git a/services/web/frontend/stories/split-test-badge.stories.jsx b/services/web/frontend/stories/split-test-badge.stories.jsx index ecb74b71d1..331263e0cb 100644 --- a/services/web/frontend/stories/split-test-badge.stories.jsx +++ b/services/web/frontend/stories/split-test-badge.stories.jsx @@ -127,7 +127,7 @@ export default { displayOnVariants: ['active'], }, decorators: [ - (Story, context) => ( + Story => ( diff --git a/services/web/frontend/stories/ui/dropdown-menu.stories.tsx b/services/web/frontend/stories/ui/dropdown-menu.stories.tsx index 5d1ac376bb..5758640ebc 100644 --- a/services/web/frontend/stories/ui/dropdown-menu.stories.tsx +++ b/services/web/frontend/stories/ui/dropdown-menu.stories.tsx @@ -60,7 +60,7 @@ export const Active = (args: Args) => { ) } -export const MultipleSelection = (args: Args) => { +export const MultipleSelection = () => { return ( Header @@ -191,7 +191,7 @@ export const LeadingIcon = (args: Args) => { ) } -export const TrailingIcon = (args: Args) => { +export const TrailingIcon = () => { return ( diff --git a/services/web/frontend/stories/ui/split-button.stories.tsx b/services/web/frontend/stories/ui/split-button.stories.tsx index 674d2e796b..01cbab9ea4 100644 --- a/services/web/frontend/stories/ui/split-button.stories.tsx +++ b/services/web/frontend/stories/ui/split-button.stories.tsx @@ -11,9 +11,7 @@ import { import Button from '@/features/ui/components/bootstrap-5/button' import { ButtonGroup } from 'react-bootstrap' -type Args = React.ComponentProps - -export const Sizes = (args: Args) => { +export const Sizes = () => { const { t } = useTranslation() const sizes = { Large: 'lg', diff --git a/services/web/test/frontend/features/dictionary/components/dictionary-modal-content.spec.jsx b/services/web/test/frontend/features/dictionary/components/dictionary-modal-content.spec.jsx index c28eef66ef..c8cdd931b3 100644 --- a/services/web/test/frontend/features/dictionary/components/dictionary-modal-content.spec.jsx +++ b/services/web/test/frontend/features/dictionary/components/dictionary-modal-content.spec.jsx @@ -19,7 +19,7 @@ describe('', function () { }) it('list words', function () { - cy.then(win => { + cy.then(() => { learnedWords.global = new Set(['foo', 'bar']) }) @@ -34,7 +34,7 @@ describe('', function () { }) it('shows message when empty', function () { - cy.then(win => { + cy.then(() => { learnedWords.global = new Set([]) }) @@ -50,7 +50,7 @@ describe('', function () { it('removes words', function () { cy.intercept('/spelling/unlearn', { statusCode: 200 }) - cy.then(win => { + cy.then(() => { learnedWords.global = new Set(['Foo', 'bar']) }) @@ -76,7 +76,7 @@ describe('', function () { it('handles errors', function () { cy.intercept('/spelling/unlearn', { statusCode: 500 }).as('unlearn') - cy.then(win => { + cy.then(() => { learnedWords.global = new Set(['foo']) }) diff --git a/services/web/test/frontend/features/settings/components/emails/add-email-input.test.tsx b/services/web/test/frontend/features/settings/components/emails/add-email-input.test.tsx index 50220152c6..694a13f32c 100644 --- a/services/web/test/frontend/features/settings/components/emails/add-email-input.test.tsx +++ b/services/web/test/frontend/features/settings/components/emails/add-email-input.test.tsx @@ -13,7 +13,7 @@ const testInstitutionData = [ describe('', function () { const defaultProps = { - onChange: (value: string) => {}, + onChange: () => {}, handleAddNewEmail: () => {}, } diff --git a/services/web/test/frontend/ide/log-parser/logParserTests.js b/services/web/test/frontend/ide/log-parser/logParserTests.js index 098ee056b9..59cdd5d22e 100644 --- a/services/web/test/frontend/ide/log-parser/logParserTests.js +++ b/services/web/test/frontend/ide/log-parser/logParserTests.js @@ -6,7 +6,7 @@ const fixturePath = '../../helpers/fixtures/logs/' const fs = require('fs') const path = require('path') -describe('logParser', function (done) { +describe('logParser', function () { it('should parse errors', function () { const { errors } = parseLatexLog('errors.log', { ignoreDuplicates: true }) expect(errors.map(e => [e.line, e.message])).to.deep.equal([