-
-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
💪 phase/solvedPost is donePost is done
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
3.1.2
Link to runnable example
No response
Steps to reproduce
import { VFileMessage } from 'vfile-message'
const message = new VFileMessage('reason')
console.log(message.position)
Expected behavior
The message position is undefined.
According to the type definitions it’s optional, but currently it’s always set.
Actual behavior
The message position is a unist position, but the start and end line and column are set to null
.
According to the unist types, start and end line and column can’t be null.
This causes various type errors. For example:
- No type errors should be suppressed in https://github.com/vfile/vfile-message/blob/main/index.js#L28-L30
- This check should not be necessary: https://github.com/unifiedjs/unified-language-server/blob/main/lib/index.js#L70-L74
This test explicitly asserts the incorrect behaviour:
Lines 63 to 66 in e5e87f2
t.deepEqual(m1.position, { | |
start: {line: null, column: null}, | |
end: {line: null, column: null} | |
}) |
Affected runtime and version
Affected package manager and version
Affected OS and version
Pop!_OS 22.04
Build and bundle tools
No response
Metadata
Metadata
Assignees
Labels
💪 phase/solvedPost is donePost is done