diff options
| author | Fuwn <[email protected]> | 2026-02-07 03:26:15 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-07 03:26:15 -0800 |
| commit | f2a5d1c04b9787bbd9f41af699345be6c0345ca8 (patch) | |
| tree | ffbbacd807f0d3d30efb7110058bd70d6404681e /apps/web/eslint-rules | |
| parent | style: lowercase all user-facing strings and add custom eslint rule (diff) | |
| download | asa.news-f2a5d1c04b9787bbd9f41af699345be6c0345ca8.tar.xz asa.news-f2a5d1c04b9787bbd9f41af699345be6c0345ca8.zip | |
feat: pre-ship polish — UI improvements, keyboard shortcuts, appearance settings
- Rename "muted keywords" to "muted phrases" throughout settings UI
- Add header with navigation to auth pages (sign-in, sign-up, etc.)
- Merge security tab (TOTP setup) into account settings tab
- Fix TOTP name input truncation on Safari (w-64 → flex-1 min-w-0)
- Add appearance settings: font size, time display format, entry images toggle, reading time toggle
- Add keyboard shortcuts dialog (? key) with all keybindings documented
- Add extended vim shortcuts: gg, G, n/N (next/prev unread), Ctrl+h/l (panel focus)
- Add command palette shortcut (⌘K) to shortcuts dialog
- Add icon URL fields for folders and custom feeds (DB + queries + settings UI)
- Add data-has-unreads attribute for sidebar keyboard navigation
- Fix SSR prerendering crash from Zustand persist and react-resizable-panels localStorage access
- Add detail panel layout persistence via useDefaultLayout
- Update marketing copy to advertise vim-like keyboard navigation
Diffstat (limited to 'apps/web/eslint-rules')
| -rw-r--r-- | apps/web/eslint-rules/no-comments.mjs | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/apps/web/eslint-rules/no-comments.mjs b/apps/web/eslint-rules/no-comments.mjs new file mode 100644 index 0000000..7efafae --- /dev/null +++ b/apps/web/eslint-rules/no-comments.mjs @@ -0,0 +1,66 @@ +const DIRECTIVE_PATTERNS = [ + /^\s*eslint-disable/, + /^\s*eslint-enable/, + /^\s*eslint-disable-next-line/, + /^\s*eslint-disable-line/, + /^\s*@ts-ignore/, + /^\s*@ts-expect-error/, + /^\s*@ts-nocheck/, + /^\s*@ts-check/, + /^\s*@type\s/, + /^\s*@param\s/, + /^\s*@returns?\s/, + /^\s*@typedef\s/, + /^\s*prettier-ignore/, + /^\s*webpackChunkName/, +] + +function isDirectiveComment(value) { + return DIRECTIVE_PATTERNS.some((pattern) => pattern.test(value)) +} + +const rule = { + meta: { + type: "suggestion", + docs: { + description: "disallow comments in favour of self-documenting code", + }, + messages: { + noComment: + "avoid comments — code should be self-documenting. refactor to make the intent clear from the code itself.", + }, + schema: [], + }, + create(context) { + const sourceCode = context.sourceCode ?? context.getSourceCode() + + return { + Program() { + for (const comment of sourceCode.getAllComments()) { + const value = comment.value.trim() + + if (!value) continue + + if (isDirectiveComment(value)) continue + + context.report({ + loc: comment.loc, + messageId: "noComment", + }) + } + }, + } + }, +} + +const plugin = { + meta: { + name: "asa-no-comments", + version: "1.0.0", + }, + rules: { + "no-comments": rule, + }, +} + +export default plugin |