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 = {
7272 fatal,
7373 line,
7474 column,
75- position : { start , end } ,
75+ position,
7676 } of messages ) {
7777 // https://github.com/remarkjs/remark-lint/issues/65#issuecomment-220800231
7878 /* istanbul ignore next */
@@ -83,6 +83,8 @@ export const remark: Rule.RuleModule = {
8383 continue
8484 }
8585
86+ const { start, end } = position || /* istanbul ignore next */ { }
87+
8688 const message : RemarkLintMessage = {
8789 reason,
8890 source,
@@ -96,11 +98,11 @@ export const remark: Rule.RuleModule = {
9698 line,
9799 // ! eslint ast column is 0-indexed, but unified is 1-indexed
98100 column : column - 1 ,
99- start : {
101+ start : start && {
100102 ...start ,
101103 column : start . column - 1 ,
102104 } ,
103- end : {
105+ end : end && {
104106 ...end ,
105107 column : end . column - 1 ,
106108 } ,
You can’t perform that action at this time.
0 commit comments