Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 9 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ const sharedGlobals = {
};

// Obsidian developer-policy / guideline checks, expressed with core rules so we
// don't pull in eslint-plugin-obsidianmd's dependency tree for seven rules. Each
// don't pull in eslint-plugin-obsidianmd's dependency tree for nine rules. Each
// entry mirrors the obsidianmd rule named in its message. Keep this scoped to
// production plugin source: tests and harness code legitimately stub Obsidian
// globals and should not inherit plugin-review restrictions.
// Unlike upstream, no-restricted-globals also flags `typeof document` and
// `typeof globalThis` guards; none exist in the plugin source.
const timerFunctions = ["setTimeout", "setInterval", "clearTimeout", "clearInterval", "requestAnimationFrame"];
const obsidianGuidelineRules = {
"no-console": ["error", { allow: ["debug", "warn", "error"] }],
"no-restricted-globals": [
"error",
...timerFunctions.map((name) => ({
Expand Down Expand Up @@ -61,6 +62,13 @@ const obsidianGuidelineRules = {
selector: "ClassDeclaration[superClass.name='PluginSettingTab'] CallExpression[callee.property.name='createEl'][arguments.0.value=/^h[1-6]$/]",
message: "Use new Setting(containerEl).setName(...).setHeading() instead of HTML headings (obsidianmd/settings-tab/no-manual-html-headings).",
},
...[
"CallExpression[callee.property.name='setHeading'] > MemberExpression > CallExpression[callee.property.name='setName']",
"CallExpression[callee.property.name='setName'][callee.object.callee.property.name='setHeading']",
].map((call) => ({
selector: `ClassDeclaration[superClass.name='PluginSettingTab'] ${call} > Literal.arguments[value=/settings|options|${pluginNamePattern}/i]`,
message: "Don't put 'settings', 'options', or the plugin name in settings headings (obsidianmd/settings-tab/no-problematic-settings-headings).",
})),
{
selector: `CallExpression[callee.property.name='addCommand'] > ObjectExpression > Property[key.name='name'] > Literal.value[value=/${pluginNamePattern}/i]`,
message: "Obsidian already prefixes command names with the plugin name (obsidianmd/commands/no-plugin-name-in-command-name).",
Expand Down
4 changes: 0 additions & 4 deletions src/Settings/metaEditSettingsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ export class MetaEditSettingsTab extends PluginSettingTab {
this.destroySvelteElements();
containerEl.empty();

new Setting(containerEl)
.setName("MetaEdit Settings")
.setHeading();

this.addProgressPropertiesSetting(containerEl);
this.addAutoPropertiesSetting(containerEl);
this.addEditMetaMenuSetting(containerEl);
Expand Down
2 changes: 1 addition & 1 deletion src/logger/consoleErrorLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class ConsoleErrorLogger extends MetaEditLogger {
const log = this.getMetaEditError(logMsg, ErrorLevel.Log);
this.addMessageToErrorLog(log);

console.log(this.formatOutputString(log));
console.debug(this.formatOutputString(log));
}

private addMessageToErrorLog(error: MetaEditError): void {
Expand Down
3 changes: 0 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ export default class MetaEdit extends Plugin {
private readonly settingsWriter = new SettingsWriter(() => this.saveData(this.settings));

async onload() {
console.log('Loading MetaEdit');

this.controller = new MetaController(this.app, this);
this.bulkEditor = new BulkMetadataEditor(this.app, this);

Expand Down Expand Up @@ -100,7 +98,6 @@ export default class MetaEdit extends Plugin {
}

onunload() {
console.log('Unloading MetaEdit');
this.linkMenu.unregisterEvent();
}

Expand Down
Loading