feat: add CI pipeline with ESLint, refactor deploy with rollback + Telegram
- Add eslint.config.mjs (flat config, eslint-config-next@16 + TypeScript) - Add .gitea/workflows/ci.yaml (lint, test:unit, build on all branches) - Refactor deploy.yaml: needs: [ci] gate, Docker rollback tag, Telegram notifications - Fix 3 pre-existing lint errors (empty interfaces, ts-ignore, require imports)
This commit is contained in:
@@ -94,9 +94,7 @@ export interface RefactorParagraphResponse {
|
||||
* This feature will analyze all user notes with embeddings to find
|
||||
* connections with cosine similarity > 0.75 and provide proactive insights.
|
||||
*/
|
||||
export interface GenerateMemoryEchoRequest {
|
||||
// No params - uses current user session
|
||||
}
|
||||
export type GenerateMemoryEchoRequest = Record<string, never>
|
||||
|
||||
export interface MemoryEchoInsight {
|
||||
note1Id: string
|
||||
|
||||
@@ -197,6 +197,7 @@ export const NoteCard = memo(function NoteCard({
|
||||
const sanitizedHtml = useMemo(() => {
|
||||
if (note.type !== 'richtext' || !note.content) return ''
|
||||
if (typeof window !== 'undefined') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
return require('isomorphic-dompurify').sanitize(note.content)
|
||||
}
|
||||
return note.content
|
||||
|
||||
@@ -85,6 +85,7 @@ function VersionPreview({ entry, language }: { entry: NoteHistoryEntry; language
|
||||
<MarkdownContent content={entry.content || ''} />
|
||||
</div>
|
||||
) : isRt ? (
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
<div dangerouslySetInnerHTML={{ __html: require('isomorphic-dompurify').sanitize(entry.content || '') }} />
|
||||
) : (
|
||||
<pre className="whitespace-pre-wrap font-sans">{entry.content || ''}</pre>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "react"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}
|
||||
export type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>
|
||||
|
||||
export function Label({ className, ...props }: LabelProps) {
|
||||
return (
|
||||
|
||||
64
memento-note/eslint.config.mjs
Normal file
64
memento-note/eslint.config.mjs
Normal file
@@ -0,0 +1,64 @@
|
||||
import { defineConfig, globalIgnores } from "eslint/config";
|
||||
import nextVitals from "eslint-config-next/core-web-vitals";
|
||||
import nextTs from "eslint-config-next/typescript";
|
||||
|
||||
const reactCompilerRules = [
|
||||
"react-hooks/hooks",
|
||||
"react-hooks/capitalized-calls",
|
||||
"react-hooks/static-components",
|
||||
"react-hooks/use-memo",
|
||||
"react-hooks/void-use-memo",
|
||||
"react-hooks/preserve-manual-memoization",
|
||||
"react-hooks/memo-dependencies",
|
||||
"react-hooks/incompatible-library",
|
||||
"react-hooks/immutability",
|
||||
"react-hooks/globals",
|
||||
"react-hooks/refs",
|
||||
"react-hooks/memoized-effect-dependencies",
|
||||
"react-hooks/exhaustive-effect-dependencies",
|
||||
"react-hooks/set-state-in-effect",
|
||||
"react-hooks/no-deriving-state-in-effects",
|
||||
"react-hooks/error-boundaries",
|
||||
"react-hooks/purity",
|
||||
"react-hooks/set-state-in-render",
|
||||
"react-hooks/invariant",
|
||||
"react-hooks/todo",
|
||||
"react-hooks/syntax",
|
||||
"react-hooks/unsupported-syntax",
|
||||
"react-hooks/config",
|
||||
"react-hooks/gating",
|
||||
"react-hooks/rule-suppression",
|
||||
"react-hooks/fbt",
|
||||
"react-hooks/component-hook-factories",
|
||||
];
|
||||
|
||||
const disabledCompilerRules = Object.fromEntries(
|
||||
reactCompilerRules.map((r) => [r, "off"])
|
||||
);
|
||||
|
||||
const eslintConfig = defineConfig([
|
||||
...nextVitals,
|
||||
...nextTs,
|
||||
globalIgnores([
|
||||
".next/**",
|
||||
"out/**",
|
||||
"build/**",
|
||||
"next-env.d.ts",
|
||||
"scripts/**",
|
||||
"prisma/**",
|
||||
"socket-server.ts",
|
||||
"tests/**",
|
||||
]),
|
||||
{
|
||||
rules: {
|
||||
...disabledCompilerRules,
|
||||
"react-hooks/exhaustive-deps": "warn",
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
"react/no-unescaped-entities": "off",
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
export default eslintConfig;
|
||||
@@ -52,7 +52,7 @@ const nextConfig: NextConfig = {
|
||||
reactStrictMode: false,
|
||||
|
||||
// Allow development origins for HMR and Dev Server access
|
||||
// @ts-ignore - Some NextConfig versions might require this in experimental
|
||||
// @ts-expect-error - Some NextConfig versions might require this in experimental
|
||||
allowedDevOrigins: ['192.168.1.83'],
|
||||
};
|
||||
|
||||
|
||||
4775
memento-note/package-lock.json
generated
4775
memento-note/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,8 @@
|
||||
"test:unit:coverage": "vitest run --coverage",
|
||||
"test:migration": "vitest run tests/migration",
|
||||
"test:migration:watch": "vitest watch tests/migration",
|
||||
"locales:agent-slide-themes": "node scripts/localize-agent-slide-themes-and-translate.mjs"
|
||||
"locales:agent-slide-themes": "node scripts/localize-agent-slide-themes-and-translate.mjs",
|
||||
"lint": "eslint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ai-sdk/anthropic": "^3.0.76",
|
||||
@@ -136,6 +137,8 @@
|
||||
"@types/react-dom": "^19",
|
||||
"@vitest/coverage-v8": "^4.0.18",
|
||||
"concurrently": "^9.2.1",
|
||||
"eslint": "^9.39.4",
|
||||
"eslint-config-next": "^16.2.6",
|
||||
"prisma": "^5.22.0",
|
||||
"tailwindcss": "^4.0.0",
|
||||
"tsx": "^4.21.0",
|
||||
|
||||
Reference in New Issue
Block a user