🔧 fix: address automated release-scan warnings

- type loadData result and processFrontMatter callbacks (no-unsafe-assignment/member-access)
- remove deprecated setDynamicTooltip (slider value now shown inline)
- end manifest description with punctuation; drop unreachable fundingUrl
- replace builtin-modules package with node:module builtinModules
This commit is contained in:
m-kk 2026-07-10 12:26:51 -05:00
parent c30a59bcab
commit 2ce3957300
5 changed files with 10 additions and 26 deletions

View file

@ -1,6 +1,6 @@
import esbuild from "esbuild";
import process from "process";
import builtins from "builtin-modules";
import { builtinModules } from "node:module";
const banner =
`/*
@ -31,7 +31,8 @@ const context = await esbuild.context({
"@lezer/common",
"@lezer/highlight",
"@lezer/lr",
...builtins],
...builtinModules,
...builtinModules.map((m) => `node:${m}`)],
format: "cjs",
target: "es2018",
logLevel: "info",

View file

@ -71,7 +71,7 @@ export default class TableOfContentsPlugin extends Plugin {
}
async loadSettings() {
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
this.settings = Object.assign({}, DEFAULT_SETTINGS, (await this.loadData()) as Partial<TOCSettings> | null);
}
async saveSettings() {
@ -153,7 +153,7 @@ export default class TableOfContentsPlugin extends Plugin {
}
} else {
await this.app.vault.process(file, (content) => replaceTOC(content, toc, isTitle));
await this.app.fileManager.processFrontMatter(file, (frontmatter) => {
await this.app.fileManager.processFrontMatter(file, (frontmatter: Record<string, unknown>) => {
frontmatter[TOC_FRONTMATTER_KEY] = { generated: true };
});
new Notice('Table of contents updated');
@ -188,7 +188,7 @@ export default class TableOfContentsPlugin extends Plugin {
await this.app.vault.process(file, (content) => removeTOCSection(content, isTitle));
}
if (hasMetadata) {
await this.app.fileManager.processFrontMatter(file, (frontmatter) => {
await this.app.fileManager.processFrontMatter(file, (frontmatter: Record<string, unknown>) => {
delete frontmatter[TOC_FRONTMATTER_KEY];
});
}
@ -301,7 +301,6 @@ class TOCSettingTab extends PluginSettingTab {
.addSlider(slider => slider
.setLimits(1, 6, 1)
.setValue(this.plugin.settings.maxDepth)
.setDynamicTooltip()
.onChange(async (value) => {
this.plugin.settings.maxDepth = value;
await this.plugin.saveSettings();

View file

@ -3,9 +3,8 @@
"name": "Table of Contents Generator",
"version": "1.1.0",
"minAppVersion": "1.7.2",
"description": "Generate a table of contents for your notes",
"description": "Generate a table of contents for your notes.",
"author": "Matt Kaili",
"authorUrl": "https://github.com/m-kk",
"isDesktopOnly": false,
"fundingUrl": "https://www.buymeacoffee.com/mkk"
"isDesktopOnly": false
}

18
package-lock.json generated
View file

@ -1,18 +1,17 @@
{
"name": "obsidian-toc-generator",
"version": "1.0.0",
"version": "1.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "obsidian-toc-generator",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",
"devDependencies": {
"@types/node": "^22.20.1",
"@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0",
"builtin-modules": "3.3.0",
"esbuild": "0.25.9",
"obsidian": "latest",
"tslib": "2.4.0",
@ -1491,19 +1490,6 @@
"node": ">=8"
}
},
"node_modules/builtin-modules": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz",
"integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",

View file

@ -16,7 +16,6 @@
"@types/node": "^22.20.1",
"@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0",
"builtin-modules": "3.3.0",
"esbuild": "0.25.9",
"obsidian": "latest",
"tslib": "2.4.0",