obsidianmd / obsidianmd/eslint-plugin
False positive: caretRangeFromPoint is the correct fallback for supported Obsidian/Electron targets
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:
caretRangeFromPointis 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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