Skip to content

Commit

Permalink
fix(commonRules): deep clone commonRules rule when parsing them
Browse files Browse the repository at this point in the history
  • Loading branch information
goerwin committed Aug 3, 2017
1 parent 088929e commit 1380d80
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/program.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as nodeHelpers from 'ego-node-helpers';
import * as fs from 'fs';
import * as glob from 'glob';
import * as _ from 'lodash';
import * as errors from './errors';
import * as types from './types';
import * as validator from './validator';
Expand Down Expand Up @@ -45,6 +46,7 @@ function getConfig(rulesPath: string): types.Config {
);
}

parsedRule = _.cloneDeep(parsedRule);
parsedRule = parseCommonRules([parsedRule])[0] as types.Rule;
parsedRule.isOptional = typeof parsedRule.isOptional === 'undefined' ?
!!rule.isOptional : parsedRule.isOptional;
Expand Down

0 comments on commit 1380d80

Please sign in to comment.