mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Snapshot custom rule definitions to prevent them from changing dynamically.
This commit is contained in:
parent
c699b8e22b
commit
14a7529ce7
3 changed files with 54 additions and 2 deletions
|
@ -2628,8 +2628,11 @@ function lintInput(options, synchronous, callback) {
|
|||
// Normalize inputs
|
||||
options = options || {};
|
||||
callback = callback || function noop() {};
|
||||
var customRuleList = [options.customRules || []].flat().map(function (rule) {
|
||||
return _objectSpread({}, rule);
|
||||
});
|
||||
// eslint-disable-next-line unicorn/prefer-spread
|
||||
var ruleList = rules.concat(options.customRules || []);
|
||||
var ruleList = rules.concat(customRuleList);
|
||||
var ruleErr = validateRuleList(ruleList, synchronous);
|
||||
if (ruleErr) {
|
||||
callback(ruleErr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue