Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import tsparser from "@typescript-eslint/parser";
import { defineConfig } from "eslint/config";
import obsidianmd from "eslint-plugin-obsidianmd";
import globals from "globals";

export default defineConfig([
...obsidianmd.configs.recommended,
{
files: ["**/*.ts"],
languageOptions: {
parser: tsparser,
parserOptions: { project: "./tsconfig.json" },
globals: {
...globals.browser,
},
},
rules: {
"obsidianmd/ui/sentence-case": [
"error",
{
// Preserve these proper nouns/acronyms that are not in the default list
ignoreWords: ["UTC", "ISO", "Unix", "GUIDs"],
},
],
},
},
]);
8 changes: 4 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ export default class TextToolsPlugin extends Plugin {

this.addCommand({
id: "join-n-lines",
name: "Join every N lines",
name: "Join every n lines",
editorCallback: (editor) => {
new TwoInputModal(this.app, {
title: "Join every N lines",
title: "Join every n lines",
label1: "N (lines per group)",
Comment thread
nilsandrey marked this conversation as resolved.
Outdated
label2: "Glue",
placeholder1: "2",
Expand Down Expand Up @@ -796,7 +796,7 @@ export default class TextToolsPlugin extends Plugin {
return;
}
this.settings.textSlots[idx] = texts.join("\n");
this.saveSettings();
void this.saveSettings();
Comment thread
nilsandrey marked this conversation as resolved.
Outdated
new Notice(`Text slot ${i} set.`);
},
});
Expand Down Expand Up @@ -844,7 +844,7 @@ export default class TextToolsPlugin extends Plugin {
// =========================================================================

async loadSettings() {
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
this.settings = Object.assign({}, DEFAULT_SETTINGS, (await this.loadData()) as Partial<TextToolsSettings>);
}

async saveSettings() {
Expand Down
Loading