Skip to content

Commit 4d38a14

Browse files
committed
Enforce sentence case in English locale
1 parent c9b070d commit 4d38a14

3 files changed

Lines changed: 403 additions & 318 deletions

File tree

docs/releases/unreleased.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ Example:
2727
## Changed
2828

2929
- TaskNotes now requires Obsidian 1.12.2 or later, matching the Obsidian APIs used by the plugin.
30+
- Improved internal code quality by resolving lint warnings, moving static inline styles into CSS utilities, and extending sentence-case lint coverage to English localization strings, with no intended behavior changes.

eslint.config.mjs

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,80 @@ import obsidianmd from "eslint-plugin-obsidianmd";
55
import prettier from "eslint-config-prettier";
66
import globals from "globals";
77

8+
const englishLocaleSentenceCaseOptions = {
9+
allowAutoFix: true,
10+
brands: [
11+
"Bases",
12+
"Brazil",
13+
"CORS",
14+
"Discord",
15+
"Farsi",
16+
"Friday",
17+
"German",
18+
"GitHub",
19+
"Google",
20+
"Google Calendar",
21+
"GTD",
22+
"HH",
23+
"iCal",
24+
"ICS",
25+
"ISO",
26+
"JavaScript",
27+
"Kanban",
28+
"Markdown",
29+
"MCP",
30+
"Microsoft",
31+
"Microsoft Outlook",
32+
"Model Context Protocol",
33+
"Monday",
34+
"N/A",
35+
"NLP",
36+
"Obsidian",
37+
"Outlook Calendar",
38+
"Persian",
39+
"Pomodoro",
40+
"RRULE",
41+
"Saturday",
42+
"Slack",
43+
"Sunday",
44+
"TaskNotes",
45+
"Thursday",
46+
"Tuesday",
47+
"UID",
48+
"UTC",
49+
"Wednesday",
50+
"Yahoo Calendar",
51+
"YYMMDD",
52+
"fr-FR",
53+
"mdbase",
54+
],
55+
ignoreRegex: [
56+
"\\b(?:YYYY-MM-DD(?:-HHMMSS)?|YYMMDD|HH:MM|HH:mm(?::ss)?|AM/PM)\\b",
57+
"\\.(?:ics|ICS)\\b",
58+
"^\\+ Add a card$",
59+
"^\\d+\\s+[a-z]+(?:\\s+[a-z]+)*(?: \\(click to manage\\))?$",
60+
"^[a-z0-9_-]+(?:, [a-z0-9_-]+)*$",
61+
"^[a-z0-9_-]+/[a-z0-9_/-]+$",
62+
"^(?:this ungrouped list|estimated|tracked|short|long|completed today|minutes|hours|days|before|after|due date|scheduled date)$",
63+
"^(?:in your browser|to navigate|to schedule|to dismiss|to select|to cancel|to create new task| to create: |of the following are true:)$",
64+
"^(?:Projects/, Work/Active, Personal|Calendar/Events)$",
65+
"^[A-Za-z0-9 _./{}|-]+\\.[A-Za-z0-9]+$",
66+
"#[0-9a-fA-F]{6}",
67+
"\\[\\[[^\\]]+\\]\\]",
68+
"\\{[^}]+\\|n\\(",
69+
"[Ee]\\.g\\.,",
70+
"'Timeblock'",
71+
"literal:",
72+
"Make sure you have backups",
73+
"obsidian-frontmatter-markdown-links",
74+
"Settings > Integrations",
75+
"Warning: TaskNotes",
76+
"/mcp endpoint",
77+
"^https?://",
78+
"TaskNotes/Views/",
79+
],
80+
};
81+
882
export default [
983
{
1084
ignores: [
@@ -96,5 +170,15 @@ export default [
96170
},
97171
},
98172

173+
{
174+
files: ["src/i18n/resources/en.ts"],
175+
rules: {
176+
"obsidianmd/ui/sentence-case-locale-module": [
177+
"warn",
178+
englishLocaleSentenceCaseOptions,
179+
],
180+
},
181+
},
182+
99183
prettier,
100184
];

0 commit comments

Comments
 (0)