mirror of
https://github.com/panatgithub/AnkiHeadingSync.git
synced 2026-07-22 06:51:43 +00:00
Fix review bot lint issues
This commit is contained in:
parent
80d6020512
commit
0f8d5eefcb
4 changed files with 25 additions and 15 deletions
12
package-lock.json
generated
12
package-lock.json
generated
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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", () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue