Skip to content

Commit 1cb3e34

Browse files
committed
fix(src): fix to break rulePaths
use copy of options.rulePaths and not use splice
1 parent 611853b commit 1cb3e34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/prh-rule.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Please set .textlinrc:
2222
var textlintRCDir = configFilePath ? path.dirname(configFilePath) : process.cwd();
2323
let helper = new RuleHelper(context);
2424
let {Syntax, getSource, report, RuleError} = context;
25-
var rulePaths = options.rulePaths;
25+
var rulePaths = options.rulePaths.slice();
2626
var config = prh.fromYAMLFilePath(path.resolve(textlintRCDir, rulePaths[0]));
27-
rulePaths.splice(1).forEach(function (rulePath) {
27+
rulePaths.slice(1).forEach(function (rulePath) {
2828
var c = prh.fromYAMLFilePath(path.resolve(textlintRCDir, rulePath));
2929
config.merge(c);
3030
});
@@ -56,7 +56,7 @@ Please set .textlinrc:
5656
var position = src.indexToPosition(changeSet.index);
5757

5858
// line, column
59-
context.report(node, new RuleError(changeSet.matches[0] + " => " + expected, {
59+
report(node, new RuleError(changeSet.matches[0] + " => " + expected, {
6060
line: position.line - 1,
6161
column: position.column
6262
}));

0 commit comments

Comments
 (0)