Skip to content

Task/review 0.12 clean - #15

Merged
sumbad merged 4 commits into
masterfrom
task/review-0.12-clean
Oct 22, 2026
Merged

sumbad merged 4 commits into
masterfrom
task/review-0.12-clean

Conversation

@sumbad

@sumbad sumbad commented Oct 22, 2026

Copy link
Copy Markdown
Member

No description provided.

The review bot reported two ERROR classes (the rest are warnings):

1. 'Disabling obsidianmd/prefer-create-el is not allowed' (harness) — the
   harness implements Obsidian's DOM helpers, so the rule flagged its own
   implementation. The shim now builds elements through a narrowly typed
   handle (the same escape hatch the export code uses for its detached
   DOMParser document), so no suppression is needed at all.

2. 'Disabling @typescript-eslint/no-explicit-any is not allowed' (22 files
   in texto/core) — the point-wise suppressions of the covariance defaults
   are gone. The types are reworked instead:
   - AnyRecord is Record<string, unknown>; AnyFn takes never[] params
   - the extension generics are constrained to 'object' and default to
     'object' — the widest honest type, so Node<CustomOptions> stays
     assignable to Node (covariance) without 'any'
   - the config handlers are METHODS, so their 'this' is compared
     bivariantly and a narrow config stays assignable to the loose one
   - the command/node-view helpers read their own options through a cast

Also in this pass:
- the build tag is a source hash instead of Date.now(): the review rebuilds
  the plugin and compares it with the released asset, and a timestamp made
  every rebuild differ ('Build output does not match the released main.js')
- README: the plugin is ~6 MB, so Obsidian Sync (Standard) does not sync
  the plugin folder — install or update it per device
- CHANGELOG: the size note and the settings-value fix

CSS stays as is: 21 browser-feature warnings are documented exceptions
(the review ignores stylelint-disable comments, and the alternatives cost
the underline styling, the mermaid editor layout or theme safety).

Gates: lint:src 0, lint:css 0, typecheck, 643 tests, 48/48 e2e, build —
main.js 6,091 kB, deterministic across builds
Live: Obsidian 1.14.4 (settings show saved values, mermaid renders) and
Android (mermaid renders, table cascade holds)
The shipped-code gate (lint:src) was already clean; these were the
repo-wide warnings from `npm run lint` — mostly in the test files:

- typed the shared obsidian mock (src/__mocks__/obsidian.ts): an untyped
  vi.fn() returns `any`, and every test reading mock.calls inherited it
- typed the per-test mocks (media/attachment/image): the dispatch
  transaction, the choice dialog callback, the image update attrs
- narrowed the JSON.parse results in the storage tests to the fields the
  test reads (no more `any` leaking into the assertions)
- the DOM helpers come from the Obsidian runtime: the tests use
  createDiv() like the plugin code does (the vitest setup installs them)
- noteStorage reads the write-log flag through window.localStorage —
  the test now does the same instead of the bare global (the rule wants
  the plugin to go through the app, and the bare global is banned)
- the um container test compares the serialized bytes element-wise
  instead of through Node's Buffer (Buffer is not defined in the browser
  globals the lint config uses)
- window.setTimeout in the notepad test, sentence case in a fixture
  title, two unused variables removed

Gates: npm run lint 0 warnings, lint:src 0, typecheck, 643 tests, 48/48
e2e, build — pass
@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes reach shared editor extension contracts and the plugin build, with runtime effects bounded to the editor and its distribution.

The PR appears safe to merge, with non-blocking improvements needed for extension types and reproducible builds.

Findings

  1. P2 Extension settings lose their types ▶
  2. P2 Rebuilds differ across platforms ▶

Summary

This PR removes explicit any types, updates test helpers, and documents the plugin's size and Sync limit.

  • Texto extensions use safer types for options, stored values, and config fields.
  • A node view is skipped when its extension returns no renderer.
  • Link editors prefill only from string href values.
  • Production builds get a repeatable tag from the source files.
  • Lint and test code is cleaned up without changing editor behavior.

Reviews (1) · Last reviewed commit: "chore(lint): clear the remaining eslint ..." · Reviewed by Greptile

Comment thread src/texto/core/@types/NodeConfig.ts Outdated
Comment thread vite.config.mts Outdated
…e build hash

Greptile P2 (NodeConfig.ts): the config handlers' `this` context had
been widened to `object` to keep the concrete extension assignable to
the framework's union — but that dropped the type of the extension's own
options/storage and forced casts in the image, attachment and task code.

Instead of widening the context, the handlers' `this` is now bivariant
(the method-extract trick, BivariantFn) — the union members that hold a
function keep their precise Options/Storage, and a narrow config still
assigns to the wide one. AnyExtension became a structural type for the
same reason. The casts the widening had forced are gone: the type
checks are back.

Greptile P2 (vite.config.mts): the source hash mixed the platform path
separators, so the same sources hashed differently on Windows and the
release build (Linux) and the review's rebuild carried different build
tags. The relative path is normalized to forward slashes now.

Gates: npm run lint 0, lint:src 0, typecheck, 643 tests, 48/48 e2e,
build — main.js 6,091 kB, deterministic across builds
Live: Obsidian 1.14.4 (settings show the saved value, Mermaid renders)
@sumbad
sumbad merged commit 71ed50c into master Oct 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant