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:
2 files changed
+7
No files matched your search
@@ -79,6 +79,7 @@ export class obsidianTypstPDFExport extends Plugin {
|
||||
`);
|
||||
|
||||
// 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.eventHandlers.handleRibbonClick(event);
|
||||
});
|
||||
|
||||
@@ -164,6 +164,8 @@ export class TypographySection implements ModalSection {
|
||||
}
|
||||
|
||||
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
|
||||
.addOption('Concourse OT', 'Concourse OT')
|
||||
.addOption('Times New Roman', 'Times New Roman')
|
||||
@@ -174,6 +176,7 @@ export class TypographySection implements ModalSection {
|
||||
.addOption('Cambria', 'Cambria')
|
||||
.addOption('Palatino', 'Palatino')
|
||||
.addOption('Book Antiqua', 'Book Antiqua');
|
||||
/* eslint-enable obsidianmd/ui/sentence-case */
|
||||
|
||||
// Set the appropriate value based on font type
|
||||
const currentValue = fontType === 'body'
|
||||
@@ -192,6 +195,8 @@ export class TypographySection implements ModalSection {
|
||||
}
|
||||
|
||||
private addFallbackMonospaceFonts(dropdown: DropdownComponent, state: ModalState): void {
|
||||
/* eslint-disable obsidianmd/ui/sentence-case */
|
||||
// Font names are proper nouns and must maintain original capitalization
|
||||
dropdown
|
||||
.addOption('Source Code Pro', 'Source Code Pro')
|
||||
.addOption('Courier New', 'Courier New')
|
||||
@@ -205,6 +210,7 @@ export class TypographySection implements ModalSection {
|
||||
.onChange((value: string) => {
|
||||
state.updateTemplateVariables({ monospaceFont: value });
|
||||
});
|
||||
/* eslint-enable obsidianmd/ui/sentence-case */
|
||||
}
|
||||
|
||||
validate(): ValidationResult {
|
||||
|
||||
Reference in new issue
Block a user