Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gavin-ts committed Jan 18, 2023
1 parent 39cee4a commit ce5758b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/docToPreviewGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export class DocToPreviewGenerator {

const fileText = trkObj.inputDoc.getText();
if (!fileText) {
return; // Empty document, do nothing
// Empty document, do nothing
return;
}

const data: string = this.generateFromText(fileText);
Expand Down
16 changes: 6 additions & 10 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { DocToPreviewGenerator } from "./docToPreviewGenerator";
import { DocumentFormatter } from "./documentFormatter";
import { D2OutputChannel } from "./outputChannel";
import mdItContainer = require("markdown-it-container");
import * as mdItContainer from "markdown-it-container";
import { layoutPicker } from "./layoutPicker";
import { themePicker } from "./themePicker";

Expand All @@ -35,6 +35,7 @@ export let ws: WorkspaceConfiguration =
export let outputChannel: D2OutputChannel;
export let extContext: ExtensionContext;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function activate(context: ExtensionContext): any {
extContext = context;
outputChannel = new D2OutputChannel();
Expand All @@ -49,7 +50,7 @@ export function activate(context: ExtensionContext): any {
ws.get("previewTheme") !== wsOld.get("previewTheme")
) {
const activeEditor = window.activeTextEditor;
if (activeEditor?.document.languageId == d2Ext) {
if (activeEditor?.document.languageId === d2Ext) {
previewGenerator.generate(activeEditor.document);
}
}
Expand Down Expand Up @@ -130,12 +131,12 @@ export function activate(context: ExtensionContext): any {
{ language: d2Lang, scheme: "file" },
{
provideDocumentFormattingEdits(document: TextDocument): TextEdit[] {
const editor = window.visibleTextEditors.find(
const documentEditor = window.visibleTextEditors.find(
(editor) => editor.document === document
);

if (editor) {
documentFormatter.format(editor);
if (documentEditor) {
documentFormatter.format(documentEditor);
}

return [];
Expand Down Expand Up @@ -191,11 +192,6 @@ export function activate(context: ExtensionContext): any {
};
}

// This method is called when your extension is deactivated
export function deactivate(): void {
undefined;
}

const pluginKeyword = "d2";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/refreshTimer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { d2ConfigSection, ws } from "./extension";
import { ws } from "./extension";

/**
* RefreshTimer - Allow for auto updates when the
Expand Down

0 comments on commit ce5758b

Please sign in to comment.