Our own keyless Bun service (not Linky's): watches relays for kind-1059 wraps
carrying the plaintext marker ["skatespots","push"] on the recipient copy,
extracts only {recipient, wrapId}, and sends a Web Push. NEVER decrypts - the
client fetches + decrypts the named wrap itself.
Endpoints: GET /health, GET /vapid-public-key, POST /auth/challenge ->
/subscribe|/unsubscribe with a one-time NIP-98 (kind 27235) challenge proof.
State is a JSON file; VAPID keys from env. Wired like the other standalone
servers (typecheck:push + check:push in npm test, deploy:push, Caddyfile +
systemd unit). Verified locally end-to-end: auth -> subscribe -> marked wrap ->
watcher -> push attempt, and proof replay rejected.
Client half (service worker, subscribe hook + Settings toggle, marker on DM
sends) is the next step.
103 lines
3.4 KiB
JavaScript
103 lines
3.4 KiB
JavaScript
import js from "@eslint/js";
|
|
import globals from "globals";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
import tseslint from "typescript-eslint";
|
|
import htmlEslint from "@html-eslint/eslint-plugin";
|
|
import htmlParser from "@html-eslint/parser";
|
|
import customRules from "./eslint-rules/index.js";
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: [
|
|
"dist",
|
|
// Build output & native shells — generated, not our source.
|
|
"android",
|
|
"ios",
|
|
// Skill templates carried along in the repo; they target a different
|
|
// ESLint ruleset (react-hooks/set-state-in-effect, purity) not installed
|
|
// here, and are never bundled into the app.
|
|
".agents",
|
|
// Standalone Bun server — type-checked by its own tsconfig (see the
|
|
// `typecheck:cvm` script, wired into `npm test`), not by the web ESLint
|
|
// config (it leans on `any` and has no React rules).
|
|
"cvm-server",
|
|
// Standalone Bun AI proxy — same deal: own tsconfig (`typecheck:ai`).
|
|
"ai-proxy",
|
|
// Standalone Bun push service — own tsconfig (`typecheck:push`).
|
|
"push-service",
|
|
// Static utility HTML (icon generators, sticker sheets, QR pages) that
|
|
// are intentionally minimal and don't need app-level meta/OG tags.
|
|
"public/**/*.html",
|
|
"scripts",
|
|
],
|
|
},
|
|
{
|
|
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
files: ["**/*.{ts,tsx}"],
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
globals: globals.browser,
|
|
},
|
|
linterOptions: {
|
|
reportUnusedDisableDirectives: "error", // Reports unused disable directives as errors
|
|
},
|
|
plugins: {
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh,
|
|
"custom": customRules,
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
"react-refresh/only-export-components": [
|
|
"warn",
|
|
{ allowConstantExport: true },
|
|
],
|
|
// Explicit `any` is discouraged but not a runtime bug (tsconfig already
|
|
// has noImplicitAny:false). Warn instead of failing the release build.
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
// Unused vars/imports are code-cleanliness issues, not runtime bugs
|
|
// (tsc catches the bug-causing undefined references). Keep them visible
|
|
// as warnings so they don't block a release build, but still surface.
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{
|
|
"argsIgnorePattern": "^_",
|
|
"varsIgnorePattern": "^_",
|
|
"ignoreRestSiblings": true,
|
|
},
|
|
],
|
|
"custom/no-placeholder-comments": "error",
|
|
"no-warning-comments": [
|
|
"error",
|
|
{ terms: ["fixme"] },
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: ["**/*.html"],
|
|
plugins: {
|
|
"@html-eslint": htmlEslint,
|
|
"custom": customRules,
|
|
},
|
|
languageOptions: {
|
|
parser: htmlParser,
|
|
},
|
|
rules: {
|
|
"@html-eslint/require-title": "error",
|
|
"@html-eslint/require-meta-charset": "error",
|
|
"@html-eslint/require-meta-description": "error",
|
|
"@html-eslint/require-meta-viewport": "error",
|
|
"@html-eslint/require-open-graph-protocol": [
|
|
"error",
|
|
[
|
|
"og:type",
|
|
"og:title",
|
|
"og:description",
|
|
],
|
|
],
|
|
"custom/no-inline-script": "error",
|
|
"custom/require-webmanifest": "error",
|
|
},
|
|
}
|
|
);
|