File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
packages/eslint-plugin-mdx/src/rules Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " eslint-plugin-mdx " : patch
3
+ ---
4
+
5
+ fix: ` position ` could be ` null ` actually - related to #520
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ export const remark: Rule.RuleModule = {
72
72
fatal,
73
73
line,
74
74
column,
75
- position : { start , end } ,
75
+ position,
76
76
} of messages ) {
77
77
// https://github.com/remarkjs/remark-lint/issues/65#issuecomment-220800231
78
78
/* istanbul ignore next */
@@ -83,6 +83,8 @@ export const remark: Rule.RuleModule = {
83
83
continue
84
84
}
85
85
86
+ const { start, end } = position || /* istanbul ignore next */ { }
87
+
86
88
const message : RemarkLintMessage = {
87
89
reason,
88
90
source,
@@ -96,11 +98,11 @@ export const remark: Rule.RuleModule = {
96
98
line,
97
99
// ! eslint ast column is 0-indexed, but unified is 1-indexed
98
100
column : column - 1 ,
99
- start : {
101
+ start : start && {
100
102
...start ,
101
103
column : start . column - 1 ,
102
104
} ,
103
- end : {
105
+ end : end && {
104
106
...end ,
105
107
column : end . column - 1 ,
106
108
} ,
You can’t perform that action at this time.
0 commit comments