Files
genoffice/eslint.config.mjs
T
merrick-2002andGenOffice e249c3ba81 Sync snapshot (2026-08-09) (#75)
- PDF: in-place text editing — paragraph block selection with reflow, bold/italic and alignment controls, selection-level text color, original-font preservation
- PDF: AI image tools (search/generate, insert, transform, delete) plus image rotation and in-place replacement
- Docs: picture rotation and mirror flips, in-place image byte swap for crop/background removal, and several Word-fidelity rendering fixes
- Docs: fix a renderer hang on tab-heavy forms and a crash when exporting large documents
- Slides: AI picture tools (crop, opacity, replace), picture border controls, in-place picture source swap
- Linux: AppImage and deb packaging with stable/beta auto-update channels
- Refresh the README and clean up internal design-audit artifacts

Co-authored-by: GenOffice <merrick-2002@users.noreply.github.com>
2026-08-10 01:43:24 +08:00

71 lines
2.0 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/**',
],
},
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',
},
},
{
// 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',
},
},
)