summaryrefslogtreecommitdiff
path: root/apps/web/lib
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-07 02:00:59 -0800
committerFuwn <[email protected]>2026-02-07 02:00:59 -0800
commitf93bad7da47093a12116ff0f390abb548289b600 (patch)
treee2a9debcca3473af8f293c3215704549e5bde17f /apps/web/lib
parentstyle: format Go worker with iku (diff)
downloadasa.news-f93bad7da47093a12116ff0f390abb548289b600.tar.xz
asa.news-f93bad7da47093a12116ff0f390abb548289b600.zip
style: lowercase all user-facing strings and add custom eslint rule
Comprehensive sweep of all user-facing text to enforce lowercase convention, including acronyms (api, rest, http, opml, json, totp, mfa, qr, hmac). Added asa-lowercase/lowercase-strings eslint rule that reports uppercase in notify() calls, error messages, jsx text, and checked attributes (placeholder, alt, title).
Diffstat (limited to 'apps/web/lib')
-rw-r--r--apps/web/lib/api-auth.ts10
-rw-r--r--apps/web/lib/opml.ts4
-rw-r--r--apps/web/lib/queries/use-custom-feed-mutations.ts2
-rw-r--r--apps/web/lib/queries/use-custom-feeds.ts2
-rw-r--r--apps/web/lib/queries/use-entry-state-mutations.ts4
-rw-r--r--apps/web/lib/queries/use-folder-mutations.ts4
-rw-r--r--apps/web/lib/queries/use-highlight-mutations.ts2
-rw-r--r--apps/web/lib/queries/use-muted-keyword-mutations.ts2
-rw-r--r--apps/web/lib/queries/use-subscription-mutations.ts2
-rw-r--r--apps/web/lib/queries/use-user-profile.ts2
10 files changed, 17 insertions, 17 deletions
diff --git a/apps/web/lib/api-auth.ts b/apps/web/lib/api-auth.ts
index 309fbe9..3f819f2 100644
--- a/apps/web/lib/api-auth.ts
+++ b/apps/web/lib/api-auth.ts
@@ -19,14 +19,14 @@ export async function authenticateApiRequest(
return {
authenticated: false,
status: 401,
- error: "Missing or invalid Authorization header",
+ error: "missing or invalid authorization header",
}
}
const apiKey = authorizationHeader.slice(7)
if (!apiKey.startsWith("asn_")) {
- return { authenticated: false, status: 401, error: "Invalid API key format" }
+ return { authenticated: false, status: 401, error: "invalid api key format" }
}
const keyHash = hashApiKey(apiKey)
@@ -40,7 +40,7 @@ export async function authenticateApiRequest(
.single()
if (!keyRow) {
- return { authenticated: false, status: 401, error: "Invalid or revoked API key" }
+ return { authenticated: false, status: 401, error: "invalid or revoked api key" }
}
const { data: userProfile } = await adminClient
@@ -53,7 +53,7 @@ export async function authenticateApiRequest(
return {
authenticated: false,
status: 403,
- error: "API access requires the developer plan",
+ error: "api access requires the developer plan",
}
}
@@ -63,7 +63,7 @@ export async function authenticateApiRequest(
return {
authenticated: false,
status: 429,
- error: `Rate limit exceeded. ${rateLimitResult.remaining} requests remaining.`,
+ error: `rate limit exceeded. ${rateLimitResult.remaining} requests remaining.`,
}
}
diff --git a/apps/web/lib/opml.ts b/apps/web/lib/opml.ts
index bd0c3a7..5c0e3e2 100644
--- a/apps/web/lib/opml.ts
+++ b/apps/web/lib/opml.ts
@@ -87,13 +87,13 @@ export function parseOpml(xmlString: string): ParsedOpmlGroup[] {
const parseError = document.querySelector("parsererror")
if (parseError) {
- throw new Error("Invalid OPML file")
+ throw new Error("invalid opml file")
}
const body = document.querySelector("body")
if (!body) {
- throw new Error("Invalid OPML: no body element")
+ throw new Error("invalid opml: no body element")
}
const groups: ParsedOpmlGroup[] = []
diff --git a/apps/web/lib/queries/use-custom-feed-mutations.ts b/apps/web/lib/queries/use-custom-feed-mutations.ts
index f0751db..ad6b328 100644
--- a/apps/web/lib/queries/use-custom-feed-mutations.ts
+++ b/apps/web/lib/queries/use-custom-feed-mutations.ts
@@ -25,7 +25,7 @@ export function useCreateCustomFeed() {
data: { user },
} = await supabaseClient.auth.getUser()
- if (!user) throw new Error("Not authenticated")
+ if (!user) throw new Error("not authenticated")
const { error } = await supabaseClient.from("custom_feeds").insert({
user_id: user.id,
diff --git a/apps/web/lib/queries/use-custom-feeds.ts b/apps/web/lib/queries/use-custom-feeds.ts
index 5c11721..a93e431 100644
--- a/apps/web/lib/queries/use-custom-feeds.ts
+++ b/apps/web/lib/queries/use-custom-feeds.ts
@@ -24,7 +24,7 @@ export function useCustomFeeds() {
data: { user },
} = await supabaseClient.auth.getUser()
- if (!user) throw new Error("Not authenticated")
+ if (!user) throw new Error("not authenticated")
const { data, error } = await supabaseClient
.from("custom_feeds")
diff --git a/apps/web/lib/queries/use-entry-state-mutations.ts b/apps/web/lib/queries/use-entry-state-mutations.ts
index 5f79fc0..a8c72d0 100644
--- a/apps/web/lib/queries/use-entry-state-mutations.ts
+++ b/apps/web/lib/queries/use-entry-state-mutations.ts
@@ -22,7 +22,7 @@ export function useToggleEntryReadState() {
data: { user },
} = await supabaseClient.auth.getUser()
- if (!user) throw new Error("Not authenticated")
+ if (!user) throw new Error("not authenticated")
const { error } = await supabaseClient
.from("user_entry_states")
@@ -88,7 +88,7 @@ export function useToggleEntrySavedState() {
data: { user },
} = await supabaseClient.auth.getUser()
- if (!user) throw new Error("Not authenticated")
+ if (!user) throw new Error("not authenticated")
const { error } = await supabaseClient
.from("user_entry_states")
diff --git a/apps/web/lib/queries/use-folder-mutations.ts b/apps/web/lib/queries/use-folder-mutations.ts
index 8595a60..642bd96 100644
--- a/apps/web/lib/queries/use-folder-mutations.ts
+++ b/apps/web/lib/queries/use-folder-mutations.ts
@@ -15,7 +15,7 @@ export function useCreateFolder() {
data: { user },
} = await supabaseClient.auth.getUser()
- if (!user) throw new Error("Not authenticated")
+ if (!user) throw new Error("not authenticated")
const { error } = await supabaseClient.from("folders").insert({
user_id: user.id,
@@ -48,7 +48,7 @@ export function useDeleteAllFolders() {
data: { user },
} = await supabaseClient.auth.getUser()
- if (!user) throw new Error("Not authenticated")
+ if (!user) throw new Error("not authenticated")
await supabaseClient
.from("subscriptions")
diff --git a/apps/web/lib/queries/use-highlight-mutations.ts b/apps/web/lib/queries/use-highlight-mutations.ts
index 0e228c8..6c9dbb7 100644
--- a/apps/web/lib/queries/use-highlight-mutations.ts
+++ b/apps/web/lib/queries/use-highlight-mutations.ts
@@ -26,7 +26,7 @@ export function useCreateHighlight() {
data: { user },
} = await supabaseClient.auth.getUser()
- if (!user) throw new Error("Not authenticated")
+ if (!user) throw new Error("not authenticated")
const { data, error } = await supabaseClient
.from("user_highlights")
diff --git a/apps/web/lib/queries/use-muted-keyword-mutations.ts b/apps/web/lib/queries/use-muted-keyword-mutations.ts
index 67bcf33..de4e03f 100644
--- a/apps/web/lib/queries/use-muted-keyword-mutations.ts
+++ b/apps/web/lib/queries/use-muted-keyword-mutations.ts
@@ -15,7 +15,7 @@ export function useAddMutedKeyword() {
data: { user },
} = await supabaseClient.auth.getUser()
- if (!user) throw new Error("Not authenticated")
+ if (!user) throw new Error("not authenticated")
const { error } = await supabaseClient.from("muted_keywords").insert({
user_id: user.id,
diff --git a/apps/web/lib/queries/use-subscription-mutations.ts b/apps/web/lib/queries/use-subscription-mutations.ts
index 3b4b3ba..3162d96 100644
--- a/apps/web/lib/queries/use-subscription-mutations.ts
+++ b/apps/web/lib/queries/use-subscription-mutations.ts
@@ -109,7 +109,7 @@ export function useUnsubscribeAll() {
data: { user },
} = await supabaseClient.auth.getUser()
- if (!user) throw new Error("Not authenticated")
+ if (!user) throw new Error("not authenticated")
const { error } = await supabaseClient
.from("subscriptions")
diff --git a/apps/web/lib/queries/use-user-profile.ts b/apps/web/lib/queries/use-user-profile.ts
index 760f970..49c1c4e 100644
--- a/apps/web/lib/queries/use-user-profile.ts
+++ b/apps/web/lib/queries/use-user-profile.ts
@@ -15,7 +15,7 @@ export function useUserProfile() {
data: { user },
} = await supabaseClient.auth.getUser()
- if (!user) throw new Error("Not authenticated")
+ if (!user) throw new Error("not authenticated")
const { data, error } = await supabaseClient
.from("user_profiles")