grunt-merge-conflict
Version:
Grunt plugin for preventing you from accidentally comitting a merge conflict into your project
21 lines (17 loc) • 391 B
JavaScript
var disallowed = [
'<<<<<<<',
'=======',
'>>>>>>>'
];
// returns undefined || an array of problem line numbers
module.exports = function (fileContents) {
var lines = fileContents.split('\n');
var errs;
lines.forEach(function (line, num) {
if (disallowed.indexOf(line.substr(0, 7)) !== -1) {
errs = errs || [];
errs.push(num + 1);
}
});
return errs;
};