diff --git a/packages/foam-vscode/src/core/janitor/convert-links-format.test.ts b/packages/foam-vscode/src/core/janitor/convert-links-format.test.ts index b0c8b3eae..13b9b3044 100644 --- a/packages/foam-vscode/src/core/janitor/convert-links-format.test.ts +++ b/packages/foam-vscode/src/core/janitor/convert-links-format.test.ts @@ -52,7 +52,7 @@ describe('generateStdMdLink', () => { '[first-document](first-document.md)', ]; expect(actual.length).toEqual(expected.length); - const _ = actual.map((LinkReplace, index) => { + actual.forEach((LinkReplace, index) => { expect(LinkReplace.newText).toEqual(expected[index]); }); }); @@ -64,7 +64,7 @@ describe('generateStdMdLink', () => { .map(link => convertLinkFormat(link, 'wikilink', _workspace, note)); const expected: string[] = ['[[first-document|file]]']; expect(actual.length).toEqual(expected.length); - const _ = actual.map((LinkReplace, index) => { + actual.forEach((LinkReplace, index) => { expect(LinkReplace.newText).toEqual(expected[index]); }); }); diff --git a/packages/foam-vscode/src/core/model/graph.ts b/packages/foam-vscode/src/core/model/graph.ts index 49070a352..1e5860c0e 100644 --- a/packages/foam-vscode/src/core/model/graph.ts +++ b/packages/foam-vscode/src/core/model/graph.ts @@ -3,7 +3,7 @@ import { ResourceLink } from './note'; import { URI } from './uri'; import { FoamWorkspace } from './workspace'; import { IDisposable } from '../common/lifecycle'; -import { Logger, withTiming } from '../utils/log'; +import { Logger } from '../utils/log'; import { Emitter } from '../common/event'; export type Connection = { diff --git a/packages/foam-vscode/src/core/model/location.ts b/packages/foam-vscode/src/core/model/location.ts index 53d0819d7..3241d1756 100644 --- a/packages/foam-vscode/src/core/model/location.ts +++ b/packages/foam-vscode/src/core/model/location.ts @@ -1,6 +1,5 @@ import { Range } from './range'; import { URI } from './uri'; -import { ResourceLink } from './note'; /** * Represents a location inside a resource, such as a line diff --git a/packages/foam-vscode/src/core/model/uri.ts b/packages/foam-vscode/src/core/model/uri.ts index 6c2c0b040..16010d1c0 100644 --- a/packages/foam-vscode/src/core/model/uri.ts +++ b/packages/foam-vscode/src/core/model/uri.ts @@ -195,7 +195,6 @@ function encode(uri: URI, skipEncoding: boolean): string { : encodeURIComponentMinimal; let res = ''; - // eslint-disable-next-line prefer-const let { scheme, authority, path, query, fragment } = uri; if (scheme) { res += scheme; diff --git a/packages/foam-vscode/src/core/services/markdown-parser.ts b/packages/foam-vscode/src/core/services/markdown-parser.ts index bdec510c0..9f7da2b47 100644 --- a/packages/foam-vscode/src/core/services/markdown-parser.ts +++ b/packages/foam-vscode/src/core/services/markdown-parser.ts @@ -459,9 +459,9 @@ export const getBlockFor = ( } }); - let nLines = startLine == -1 ? 1 : endLine - startLine; + let nLines = startLine === -1 ? 1 : endLine - startLine; let block = - startLine == -1 + startLine === -1 ? lines[searchLine] ?? '' : lines.slice(startLine, endLine).join('\n'); diff --git a/packages/foam-vscode/src/extension.ts b/packages/foam-vscode/src/extension.ts index 6d15df44a..f27bdf604 100644 --- a/packages/foam-vscode/src/extension.ts +++ b/packages/foam-vscode/src/extension.ts @@ -17,7 +17,6 @@ import { VsCodeWatcher } from './services/watcher'; import { createMarkdownParser } from './core/services/markdown-parser'; import VsCodeBasedParserCache from './services/cache'; import { createMatcherAndDataStore } from './services/editor'; -import { getFoamVsCodeConfig } from './services/config'; export async function activate(context: ExtensionContext) { const logger = new VsCodeOutputLogger(); diff --git a/packages/foam-vscode/src/features/commands/create-note.spec.ts b/packages/foam-vscode/src/features/commands/create-note.spec.ts index 4bbad0ee8..3c5fed0de 100644 --- a/packages/foam-vscode/src/features/commands/create-note.spec.ts +++ b/packages/foam-vscode/src/features/commands/create-note.spec.ts @@ -14,7 +14,6 @@ import { CREATE_NOTE_COMMAND, createNote } from './create-note'; import { Location } from '../../core/model/location'; import { Range } from '../../core/model/range'; import { ResourceLink } from '../../core/model/note'; -import { MarkdownResourceProvider } from '../../core/services/markdown-provider'; import { createMarkdownParser } from '../../core/services/markdown-parser'; describe('create-note command', () => { diff --git a/packages/foam-vscode/src/features/commands/create-note.ts b/packages/foam-vscode/src/features/commands/create-note.ts index 633c8be44..abfd322e2 100644 --- a/packages/foam-vscode/src/features/commands/create-note.ts +++ b/packages/foam-vscode/src/features/commands/create-note.ts @@ -129,7 +129,7 @@ export async function createNote(args: CreateNoteArgs, foam: Foam) { const edit = MarkdownLink.createUpdateLinkEdit(args.sourceLink.data, { target: identifier, }); - if (edit.newText != args.sourceLink.data.rawText) { + if (edit.newText !== args.sourceLink.data.rawText) { const updateLink = new vscode.WorkspaceEdit(); const uri = toVsCodeUri(args.sourceLink.uri); updateLink.replace( diff --git a/packages/foam-vscode/src/features/navigation-provider.spec.ts b/packages/foam-vscode/src/features/navigation-provider.spec.ts index 2e392e8da..c03a14b1c 100644 --- a/packages/foam-vscode/src/features/navigation-provider.spec.ts +++ b/packages/foam-vscode/src/features/navigation-provider.spec.ts @@ -13,9 +13,6 @@ import { FoamGraph } from '../core/model/graph'; import { commandAsURI } from '../utils/commands'; import { CREATE_NOTE_COMMAND } from './commands/create-note'; import { Location } from '../core/model/location'; -import { URI } from '../core/model/uri'; -import { Range } from '../core/model/range'; -import { ResourceLink } from '../core/model/note'; describe('Document navigation', () => { const parser = createMarkdownParser([]); diff --git a/packages/foam-vscode/src/features/panels/connections.ts b/packages/foam-vscode/src/features/panels/connections.ts index 5f0003f44..f34c71b5c 100644 --- a/packages/foam-vscode/src/features/panels/connections.ts +++ b/packages/foam-vscode/src/features/panels/connections.ts @@ -30,7 +30,6 @@ export default async function activate( treeDataProvider: provider, showCollapseAll: true, }); - const baseTitle = treeView.title; const updateTreeView = async () => { provider.target = vscode.window.activeTextEditor diff --git a/packages/foam-vscode/src/features/panels/dataviz.ts b/packages/foam-vscode/src/features/panels/dataviz.ts index 2dcf9c2cc..dff44b6e7 100644 --- a/packages/foam-vscode/src/features/panels/dataviz.ts +++ b/packages/foam-vscode/src/features/panels/dataviz.ts @@ -175,7 +175,7 @@ async function getWebviewContent( panel.webview.asWebviewUri(vscode.Uri.joinPath(datavizUri, fileName)); const indexHtml = - vscode.env.uiKind == vscode.UIKind.Desktop + vscode.env.uiKind === vscode.UIKind.Desktop ? new TextDecoder('utf-8').decode( await vscode.workspace.fs.readFile( vscode.Uri.joinPath(datavizUri, 'index.html') diff --git a/packages/foam-vscode/src/features/preview/wikilink-embed.ts b/packages/foam-vscode/src/features/preview/wikilink-embed.ts index dab4f953e..d8e554453 100644 --- a/packages/foam-vscode/src/features/preview/wikilink-embed.ts +++ b/packages/foam-vscode/src/features/preview/wikilink-embed.ts @@ -34,7 +34,7 @@ export const markdownItWikilinkEmbed = ( regex: WIKILINK_EMBED_REGEX, replace: (wikilinkItem: string) => { try { - const [_, noteEmbedModifier, wikilink] = wikilinkItem.match( + const [, noteEmbedModifier, wikilink] = wikilinkItem.match( WIKILINK_EMBED_REGEX_GROUPS );