Skip to content

Commit 1a81c44

Browse files
fix: undefined place in vFile message causes TypeError (#521)
Many remark-lint errors do not set a place variable in the vFile message. This code should accept undefined for this field. fixes #520 Co-authored-by: JounQin <[email protected]>
1 parent 4623359 commit 1a81c44

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/new-brooms-visit.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"eslint-plugin-mdx": patch
3+
---
4+
5+
fix: `undefined` `place` in vFile message causes TypeError
6+
7+
Many `remark-lint` errors do not set a place variable in the vFile
8+
message. This code should accept `undefined` for this field.
9+
10+
fixes #520

packages/eslint-plugin-mdx/src/rules/remark.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const remark: Rule.RuleModule = {
100100
// related to https://github.com/eslint/eslint/issues/14198
101101
message: JSON.stringify(message),
102102
loc:
103-
/* istanbul ignore next */ 'start' in place
103+
/* istanbul ignore next */ place && 'start' in place
104104
? {
105105
...point,
106106
start: { ...place.start, column: place.start.column - 1 },

0 commit comments

Comments
 (0)