diff --git a/package-lock.json b/package-lock.json index e05bd0c..1556b58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "obsidian-anki-heading-sync", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "obsidian-anki-heading-sync", - "version": "1.0.1", + "version": "1.0.2", "license": "MIT", "dependencies": { "markdown-it": "^14.1.0" @@ -20,7 +20,7 @@ "builtin-modules": "^4.0.0", "esbuild": "^0.25.3", "eslint": "^9.39.1", - "eslint-plugin-obsidianmd": "^0.2.8", + "eslint-plugin-obsidianmd": "^0.2.9", "globals": "^16.4.0", "obsidian": "1.12.3", "typescript": "^5.8.3", @@ -2487,9 +2487,9 @@ } }, "node_modules/eslint-plugin-obsidianmd": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/eslint-plugin-obsidianmd/-/eslint-plugin-obsidianmd-0.2.8.tgz", - "integrity": "sha512-BttDFIqh2f4sDurRgNZ8psjtgnYC7Y8toLaXgyqgmI9CXEE2dBEWXaG+p9vnmJLJQJWURTZL6LUXUNY4IGgBNw==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/eslint-plugin-obsidianmd/-/eslint-plugin-obsidianmd-0.2.9.tgz", + "integrity": "sha512-+dF5Zz5T6/j0QYGu+wHbY3UZb45Kh+QFkFdfvkVk05o4YIIVqHMlrTFrlRVhuBd6Htu8QxcFOwzeMTN4aysVTA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index cc57b0e..3f2568c 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "builtin-modules": "^4.0.0", "esbuild": "^0.25.3", "eslint": "^9.39.1", - "eslint-plugin-obsidianmd": "^0.2.8", + "eslint-plugin-obsidianmd": "^0.2.9", "globals": "^16.4.0", "obsidian": "1.12.3", "typescript": "^5.8.3", diff --git a/src/presentation/i18n/messages/en.ts b/src/presentation/i18n/messages/en.ts index 8cede41..02ff0d4 100644 --- a/src/presentation/i18n/messages/en.ts +++ b/src/presentation/i18n/messages/en.ts @@ -18,11 +18,11 @@ export const en = { }, qaHeadingLevel: { name: "Heading level for question-and-answer cards", - desc: "Default: H4", + desc: "Use heading level 4 by default.", }, clozeHeadingLevel: { name: "Cloze heading level", - desc: "Default: H5", + desc: "Use heading level 5 by default.", }, cardAnswerCutoffMode: { name: "Card answer cutoff mode", @@ -413,7 +413,7 @@ export const en = { noteFieldMappingsQaGroupAcceptedWarningsArray: "Question-and-answer group field mapping acceptedWarnings must be an array.", noteFieldMappingsQaGroupAcceptedWarningsStrings: "Question-and-answer group field mapping acceptedWarnings can only contain strings.", noteFieldMappingsQaGroupDerivationObject: "Question-and-answer group field mapping derivation must be an object.", - noteFieldMappingsQaGroupDerivationMode: "QA Group field mapping derivation.mode must be first-pair.", + noteFieldMappingsQaGroupDerivationMode: "Question-and-answer group field mapping derivation.mode must be first-pair.", noteFieldMappingsQaGroupDerivationFirstQuestionField: "Question-and-answer group field mapping derivation.firstQuestionField must be a string.", noteFieldMappingsQaGroupDerivationFirstAnswerField: "Question-and-answer group field mapping derivation.firstAnswerField must be a string.", }, diff --git a/src/presentation/settings/PluginSettingTab.test.ts b/src/presentation/settings/PluginSettingTab.test.ts index 328cee7..b6ed764 100644 --- a/src/presentation/settings/PluginSettingTab.test.ts +++ b/src/presentation/settings/PluginSettingTab.test.ts @@ -707,20 +707,30 @@ type TestActiveWindow = { type TestWindow = { activeWindow: TestActiveWindow; ResizeObserver: typeof ResizeObserver; + readonly setTimeout: typeof setTimeout; + readonly clearTimeout: typeof clearTimeout; }; function createTestWindow(): TestWindow { + let testWindow: TestWindow; + const activeWindow: TestActiveWindow = { - // eslint-disable-next-line obsidianmd/prefer-active-window-timers - setTimeout: (callback, delay) => setTimeout(callback, delay), - // eslint-disable-next-line obsidianmd/prefer-active-window-timers - clearTimeout: (timer) => clearTimeout(timer), + setTimeout: (callback, delay) => testWindow.setTimeout(callback, delay), + clearTimeout: (timer) => testWindow.clearTimeout(timer), }; - return { + testWindow = { + get setTimeout(): typeof setTimeout { + return setTimeout; + }, + get clearTimeout(): typeof clearTimeout { + return clearTimeout; + }, activeWindow, ResizeObserver: FakeResizeObserver as unknown as typeof ResizeObserver, }; + + return testWindow; } describe("PluginSettingTab", () => {