Skip to content

Commit ca71bcc

Browse files
committed
chore(lint): src/tests
Signed-off-by: Max <max@nextcloud.com>
1 parent 0bfcd9b commit ca71bcc

9 files changed

Lines changed: 11 additions & 108 deletions

File tree

src/tests/components/Editor/TableOfContents.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
displayTocKey,
1717
headingsKey,
1818
provideEditorHeadings,
19-
} from '../../../composables/useEditorHeadings'
19+
} from '../../../composables/useEditorHeadings.ts'
2020
import Heading from '../../../nodes/Heading.js'
2121
import createCustomEditor from '../../testHelpers/createCustomEditor.ts'
2222

src/tests/components/RichTextReader.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { nextTick } from 'vue'
99
import RichTextReader from '../../components/RichTextReader.vue'
1010

1111
const test = baseTest.extend({
12-
content: ({ task: _ }, use) => use(''),
12+
content: (_, use) => use(''),
1313
wrapper: async ({ content }, use) => {
1414
const wrapper = mount(RichTextReader, { propsData: { content } })
1515
await nextTick()

src/tests/helpers/links.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ vi.mock('@nextcloud/initial-state', async (importOriginal) => {
3333
return {
3434
...mod,
3535
// replace some exports
36-
loadState: (_app, key) => app,
36+
loadState: () => app,
3737
}
3838
})
3939

src/tests/markdownit/commonmark.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ describe('Commonmark', () => {
6767

6868
spec.forEach((entry) => {
6969
// We do not support HTML
70-
if (entry.section === 'HTML blocks' || entry.section === 'Raw HTML') { return }
71-
70+
if (entry.section === 'HTML blocks' || entry.section === 'Raw HTML') {
71+
return
72+
}
7273
if (skippedMarkdownTests.indexOf(entry.example) !== -1) {
7374
return
7475
}
75-
7676
test('commonmark parsing ' + entry.example, () => {
7777
let expected = entry.markdown.includes('__')
7878
? entry.html

src/tests/nodes/Mathematics.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { MathBlock, MathInline } from '../../nodes/Mathematics.js'
1212
import { markdownThroughEditor } from '../testHelpers/markdown.js'
1313

1414
const test = baseTest.extend({
15-
editor: async ({ task: _ }, use) => {
15+
editor: async (_, use) => {
1616
const editor = createRichEditor()
1717
await use(editor)
1818
editor.destroy()

src/tests/nodes/Preview.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Link from './../../marks/Link.ts'
1515
import Preview from './../../nodes/Preview.js'
1616

1717
const test = baseTest.extend({
18-
editor: async ({ task: _ }, use) => {
18+
editor: async (_, use) => {
1919
const editor = createCustomEditor('', [Markdown, Preview, Link])
2020
await use(editor)
2121
editor.destroy()

src/tests/nodes/Table.spec.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import { createRichEditor } from '../../EditorFactory.ts'
88
import { createMarkdownSerializer } from '../../extensions/Markdown.js'
99
import markdownit from '../../markdownit/index.js'
1010
import output from '../fixtures/tables/basic/table.html?raw'
11-
// Eslint does not know about ?raw suffix it seems.
12-
/* eslint-disable import/no-unresolved */
1311
import input from '../fixtures/tables/basic/table.md?raw'
1412
import otherStructure from '../fixtures/tables/basic/table.structure.html?raw'
1513
import handbook from '../fixtures/tables/handbook/handbook.html?raw'
@@ -24,11 +22,10 @@ import {
2422
thead,
2523
tr,
2624
} from '../testHelpers/builders.js'
27-
/* eslint-enable import/no-unresolved */
2825
import { markdownThroughEditor } from '../testHelpers/markdown.js'
2926

3027
const test = baseTest.extend({
31-
editor: async ({ task: _ }, use) => {
28+
editor: async (_, use) => {
3229
const editor = createRichEditor()
3330
await use(editor)
3431
editor.destroy()
@@ -261,7 +258,7 @@ describe('Table extension', () => {
261258

262259
function getHeaderCell(editor, targetIndex = 0) {
263260
let cell
264-
editor.state.doc.descendants((node, pos) => {
261+
editor.state.doc.descendants((node) => {
265262
if (!['tableHeadRow', 'tableRow'].includes(node.type.name)) {
266263
return true
267264
}

src/tests/nodes/TaskItem.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('TaskItem extension', () => {
3838
expect(markdownThroughEditor('- [ ] [asd](sdf)')).toBe('- [ ] [asd](sdf)')
3939
expect(markdownThroughEditor('- [x] [asd](sdf)')).toBe('- [x] [asd](sdf)')
4040
expect(markdownThroughEditor('- [ ] foo\n- [x] bar')).toBe('- [ ] foo\n- [x] bar')
41-
expect(markdownThroughEditor('- [x] foo\n' + ' - [ ] bar\n' + ' - [x] baz\n' + '- [ ] bim')).toBe('- [x] foo\n' + ' - [ ] bar\n' + ' - [x] baz\n' + '- [ ] bim')
41+
expect(markdownThroughEditor('- [x] foo\n - [ ] bar\n - [x] baz\n- [ ] bim')).toBe('- [x] foo\n - [ ] bar\n - [x] baz\n- [ ] bim')
4242
expect(markdownThroughEditor('- [X] asd')).toBe('- [x] asd')
4343
expect(markdownThroughEditor('- [X] asd')).toBe('- [x] asd')
4444
})

src/tests/testHelpers/builders.js

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)