mirror of
https://github.com/jesse-r-s-hines/obsidian-open-tab-settings.git
synced 2026-07-22 05:43:41 +00:00
linting fixes
This commit is contained in:
parent
55db9ae77a
commit
4110bb8c7d
3 changed files with 7 additions and 6 deletions
2
src/glob.d.ts
vendored
2
src/glob.d.ts
vendored
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
declare module 'glob:*' {
|
||||
const modules: Record<string, any>;
|
||||
const modules: Record<string, unknown>;
|
||||
export default modules;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import i18next from 'i18next';
|
||||
import i18next, {type ResourceLanguage} from 'i18next';
|
||||
import { getLanguage } from 'obsidian';
|
||||
import locales from 'glob:./locales/*.json';
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ export async function initializeI18n() {
|
|||
return await i18next.init({
|
||||
lng: getLanguage(),
|
||||
fallbackLng: 'en',
|
||||
resources: Object.fromEntries(Object.entries(locales).map(([k, v]) => [k, {translation: v}])),
|
||||
resources: Object.fromEntries(Object.entries(locales).map(([k, v]) => [k, {translation: v as ResourceLanguage}])),
|
||||
interpolation: { escapeValue: false },
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ export default class OpenTabSettingsPlugin extends Plugin {
|
|||
}
|
||||
|
||||
registerMonkeyPatches() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias -- can't use arrow functions here
|
||||
const plugin = this;
|
||||
|
||||
this.register(monkeyAround.around(Workspace.prototype, {
|
||||
|
|
@ -254,7 +254,8 @@ export default class OpenTabSettingsPlugin extends Plugin {
|
|||
);
|
||||
|
||||
let match: WorkspaceLeaf|undefined;
|
||||
if (matches.includes(this)) match = this; // eslint-disable-line @typescript-eslint/no-this-alias
|
||||
// eslint-disable-next-line -- @typescript-eslint/no-this-alias match
|
||||
if (matches.includes(this)) match = this;
|
||||
// if the link opened was an internal link, always deduplicate to undo open in new tab.
|
||||
if (!match && isInternalLink && !isSpecialOpen) {
|
||||
match = matches.find(l => l.id == openedFrom)!;
|
||||
|
|
@ -512,7 +513,7 @@ export default class OpenTabSettingsPlugin extends Plugin {
|
|||
const workspace = this.app.workspace;
|
||||
const settings = {...this.settings, ...override};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated -- needed for compatibility
|
||||
const activeLeaf = workspace.activeLeaf;
|
||||
if (activeLeaf?.canNavigate()) {
|
||||
return activeLeaf;
|
||||
|
|
|
|||
Loading…
Reference in a new issue