Files
genoffice/eslint.config.mjs
T
merrick-2002andGenOffice d24c964a3e Sync snapshot (2026-09-09) (#271)
- **New app: GenOffice HTML.** Open, edit and generate .html pages: a source pane with a sandboxed live preview, click-to-select elements with a floating toolbar and style panel, device-size preview, image tools and a present mode. AI generates whole pages from a brief with style directions and offers page-wide Restyle, Theme and Summarize. Export to Word runs locally through the built-in html2docx converter (native, editable OOXML; no print-to-PDF detour).
- **AI:** separate BYOK providers for web search, image generation and image/video analysis; new Codex App Server provider; Ask AI quotes the selected text and keeps it highlighted while it runs; custom AI panel text size; blocked requests retry through the Chromium network stack.
- **App:** global AutoSave setting shared by every editor; AI panel text size and chat spellcheck toggles (genoffice#249); Czech (cs) UI locale (genoffice#259); Save As defaults to the document's folder; PDF export no longer aborts on CJK file paths on Windows.
- **Docs:** Export as HTML; comments and replies edit in place from the comments pane; the caret can leave a trailing table (genoffice#266); spellcheck re-marks text as soon as it is re-enabled; AI edits are character-precise on partial selections; zoom keeps the scroll position; pasting a cell from Sheets takes the destination font.
- **Sheets:** Find no longer freezes on wide or streamed grids; Replace searches as you type; cached values of external-workbook formulas are kept instead of #ERROR! (genoffice#235); "number stored as text" is a warning, not an error (genoffice#236); paste repeats into the target range like Excel; filter criteria survive save/reopen; saves retry when Windows locks the file; many Excel-fidelity fixes for column widths, row heights, charts, slicers, number formats and CJK fonts.
- **Slides:** PDF export works for large presentations (genoffice#264); EMF/WMF picture fonts and East Asian theme fonts resolve correctly; decks with missing layouts or embedded styles still open; outline-only pie slices render.
- **PDF:** highlight and underline geometry aligns with the text; Shift+arrows extend the selection instead of paging.
- **Markdown:** Find and replace (Ctrl+F / Ctrl+H) (genoffice#253); mermaid code blocks render as diagrams (genoffice#263); better print quality.
- Thanks to community contributors @GoodScholar, @aniruddhaadak80 and @Sun8854, and to @hanyscz, @qgzln, @zyp997, @bisslot, @krakotay and @Ben03151 for the reports.

Co-authored-by: GenOffice <merrick-2002@users.noreply.github.com>
2026-09-09 18:19:13 +08:00

82 lines
2.5 KiB
JavaScript

// Repo-wide lint config (lint only — no formatter, so no whole-repo format diff).
// Rules are tuned so the current codebase passes cleanly; tighten incrementally.
import js from '@eslint/js'
import globals from 'globals'
import tseslint from 'typescript-eslint'
import reactHooks from 'eslint-plugin-react-hooks'
export default tseslint.config(
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/out/**',
'**/.build/**',
'**/release/**',
'**/target/**',
'**/coverage/**',
'scripts/drivers/**',
'apps/*/build/**',
'packages/*/src/vendor/**',
// Browser-side extractor fragments are function-body slices (top-level
// return), not modules; they are injected as raw text.
'packages/html2docx/src/browser/**',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
// The codebase interoperates with untyped vendor APIs (Univer, pptxgenjs,
// Electron IPC payloads); `any` at those boundaries is deliberate.
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrors: 'none',
},
],
// Empty catch = deliberate fail-open; other empty blocks still flagged.
'no-empty': ['error', { allowEmptyCatch: true }],
},
},
{
// tsc already checks undefined identifiers with full type info; eslint's
// no-undef false-positives on TS-only constructs.
files: ['**/*.{ts,tsx}'],
rules: {
'no-undef': 'off',
},
},
{
// html2docx's generation layer is ported JS under @ts-nocheck until it is
// typed file by file (packages/html2docx/README.md).
files: ['packages/html2docx/src/generate.ts', 'packages/html2docx/src/generate/**/*.ts'],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
},
},
{
// Classic hooks rules only; the React-Compiler rule set (refs, purity,
// immutability, …) is not adopted yet.
files: ['**/*.tsx'],
plugins: { 'react-hooks': reactHooks },
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
},
{
// Plain JS build/tool scripts run in Node without type info.
files: ['**/*.{js,mjs,cjs}'],
languageOptions: {
globals: { ...globals.node },
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
)