Skip to content

Commit 99935d9

Browse files
Naturalclarsmikitky
authored andcommitted
config: add lint rule to detect conflict marker (#119)
1 parent be36711 commit 99935d9

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

textlint/jp-reactjs-org-lint.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = context => {
1414
noHanPunctSpace(node, text, context);
1515
enforceZenHanSpace(node, text, context);
1616
noLineEndSpace(node, text, context);
17+
noConflictMarker(node, text, context);
1718
},
1819

1920
[context.Syntax.Str]: node => {
@@ -68,8 +69,8 @@ const enforceZenHanSpace = (node, text, context) => {
6869
context.report(
6970
node,
7071
new context.RuleError(
71-
`全角文字と半角英数字とが隣接しています("${matched}")。` +
72-
`半角スペースを挿入してください。`,
72+
`全角文字と半角英数字とが隣接しています("${matched}")。` +
73+
`半角スペースを挿入してください。`,
7374
),
7475
);
7576
}
@@ -86,3 +87,16 @@ const noLineEndSpace = (node, text, context) => {
8687
);
8788
}
8889
};
90+
91+
const noConflictMarker = (node, text, context) => {
92+
const reg = /<<<<<<< HEAD/;
93+
94+
if (reg.exec(text)) {
95+
context.report(
96+
node,
97+
new context.RuleError(
98+
'コンフリクトマーカーが残っています。コンフリクトを解消してください。',
99+
),
100+
);
101+
}
102+
};

0 commit comments

Comments
 (0)