obsidianmd / obsidianmd/eslint-plugin

False positive: caretRangeFromPoint is the correct fallback for supported Obsidian/Electron targets

Open
#175 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
111
Forks
25
PR merge metrics
No merged PRs in 30d

Description

The scanner should only report recommendations that are actually actionable in the supported runtime matrix. This recommendation is not actionable:

Recommendation: caretRangeFromPoint is deprecated.

caretRangeFromPoint() is indeed non-standard and deprecated, but in the Obsidian/Electron environment it remains the practical fallback when caretPositionFromPoint() is unavailable. The standardized caretPositionFromPoint() is only available in newer Chromium-based runtimes, and Obsidian versions running on Electron 30 or earlier do not support it. There is also a similar compatibility gap on iOS, where caretPositionFromPoint() is only available in WKWebView on iOS 17.4+.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the scanner rule that emits the caretRangeFromPoint deprecation recommendation and inspect how supported runtime targets are represented. Done means the recommendation is suppressed when caretPositionFromPoint() is unavailable in supported Obsidian/Electron or iOS environments, without hiding actionable recommendations.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.