Skip to content

Commit

Permalink
Fix lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
turulix committed Aug 29, 2024
1 parent 0d5799d commit a53bff5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install modules
run: npm i
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ data.json

# Exclude macOS Finder (System Explorer) View States
.DS_Store
yarn.lock
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {GraphManipulatorModule} from "./modules/GraphManipulatorModule";
import {EventEmitter} from "events";
import {DEFAULT_SETTINGS, PluginSetting, PluginSettingsTab} from "./models/PluginSettingsTab";
import {FolderNoteModule} from "./modules/FolderNoteModule";
import { ContextMenuModule } from './modules/ContextMenuModule';
import {ContextMenuModule} from "./modules/ContextMenuModule";


// Remember to rename these classes and interfaces!
Expand All @@ -19,7 +19,7 @@ export default class FolderIndexPlugin extends Plugin {
eventManager: EventEmitter
oldGraphSetting = false
static PLUGIN: FolderIndexPlugin;

// @ts-ignore
private contextMenuModule: ContextMenuModule;

constructor(app: App, manifest: PluginManifest) {
Expand Down Expand Up @@ -55,7 +55,7 @@ export default class FolderIndexPlugin extends Plugin {
}

this.contextMenuModule = new ContextMenuModule(this.app, this);
this.contextMenuModule.addFolderContextMenu();
this.contextMenuModule.addFolderContextMenu();
}

onSettingsUpdate() {
Expand Down
3 changes: 3 additions & 0 deletions src/models/PluginSettingsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import {App, PluginSettingTab, Setting, TextAreaComponent} from "obsidian";
import FolderIndexPlugin from "../main";

export enum SortBy {
// eslint-disable-next-line no-unused-vars
None = "Disabled",
// eslint-disable-next-line no-unused-vars
Alphabetically = "Alphabetically",
// eslint-disable-next-line no-unused-vars
ReverseAlphabetically = "Reverse Alphabetically"
}

Expand Down
7 changes: 5 additions & 2 deletions src/modules/ContextMenuModule.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { TFolder, Menu, Notice, App } from 'obsidian';
import { TFolder, Notice, App } from 'obsidian';
import FolderIndexPlugin from "../main";

export class ContextMenuModule {
// eslint-disable-next-line no-unused-vars
constructor(private app: App, private plugin: FolderIndexPlugin) {
}

Expand Down Expand Up @@ -43,10 +44,12 @@ export class ContextMenuModule {

// Notify the user
new Notice(`File "${newFile.name}" created successfully in folder "${newFile.path}".`);
// eslint-disable-next-line no-console
console.log(`File created at path: ${newFile.path}`);
} catch (error) {
// eslint-disable-next-line no-console
console.error(`Failed to create file at path: ${filePath}`, error);
new Notice("Failed to create file. See console for details.");
}
}
}
}

0 comments on commit a53bff5

Please sign in to comment.