Apply eslint overrides for capitalization in UI

Disables sentence-case rule for UI elements where proper nouns
are used, ensuring intended capitalization is preserved for
acronyms and font names. Adds comments to justify each override
and re-enables the rule after relevant sections.
This commit is contained in:
AlexKucera committed 2025-11-08 19:15:02 +01:00
1 parent 7314776057
commit c1c02ee553
2 files changed
+7

No files matched your search

+1
View File
@@ -79,6 +79,7 @@ export class obsidianTypstPDFExport extends Plugin {
`); `);
// Add ribbon icon using custom icon // Add ribbon icon using custom icon
// eslint-disable-next-line obsidianmd/ui/sentence-case -- "PDF" is an acronym and "Typst" is a proper noun
this.addRibbonIcon('typst-pdf-export', 'Export to PDF with Typst', (event: MouseEvent) => { this.addRibbonIcon('typst-pdf-export', 'Export to PDF with Typst', (event: MouseEvent) => {
this.eventHandlers.handleRibbonClick(event); this.eventHandlers.handleRibbonClick(event);
}); });
@@ -164,6 +164,8 @@ export class TypographySection implements ModalSection {
} }
private addFallbackBodyFonts(dropdown: DropdownComponent, state: ModalState, fontType: 'body' | 'heading'): void { private addFallbackBodyFonts(dropdown: DropdownComponent, state: ModalState, fontType: 'body' | 'heading'): void {
/* eslint-disable obsidianmd/ui/sentence-case */
// Font names are proper nouns and must maintain original capitalization
dropdown dropdown
.addOption('Concourse OT', 'Concourse OT') .addOption('Concourse OT', 'Concourse OT')
.addOption('Times New Roman', 'Times New Roman') .addOption('Times New Roman', 'Times New Roman')
@@ -174,6 +176,7 @@ export class TypographySection implements ModalSection {
.addOption('Cambria', 'Cambria') .addOption('Cambria', 'Cambria')
.addOption('Palatino', 'Palatino') .addOption('Palatino', 'Palatino')
.addOption('Book Antiqua', 'Book Antiqua'); .addOption('Book Antiqua', 'Book Antiqua');
/* eslint-enable obsidianmd/ui/sentence-case */
// Set the appropriate value based on font type // Set the appropriate value based on font type
const currentValue = fontType === 'body' const currentValue = fontType === 'body'
@@ -192,6 +195,8 @@ export class TypographySection implements ModalSection {
} }
private addFallbackMonospaceFonts(dropdown: DropdownComponent, state: ModalState): void { private addFallbackMonospaceFonts(dropdown: DropdownComponent, state: ModalState): void {
/* eslint-disable obsidianmd/ui/sentence-case */
// Font names are proper nouns and must maintain original capitalization
dropdown dropdown
.addOption('Source Code Pro', 'Source Code Pro') .addOption('Source Code Pro', 'Source Code Pro')
.addOption('Courier New', 'Courier New') .addOption('Courier New', 'Courier New')
@@ -205,6 +210,7 @@ export class TypographySection implements ModalSection {
.onChange((value: string) => { .onChange((value: string) => {
state.updateTemplateVariables({ monospaceFont: value }); state.updateTemplateVariables({ monospaceFont: value });
}); });
/* eslint-enable obsidianmd/ui/sentence-case */
} }
validate(): ValidationResult { validate(): ValidationResult {