mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 14:30:12 +01:00
Replace assign/clone helpers with object spread syntax.
This commit is contained in:
parent
684416a902
commit
1b8b15693f
6 changed files with 51 additions and 55 deletions
|
|
@ -271,7 +271,7 @@ function getEnabledRulesPerLineNumber(
|
|||
if (!noInlineConfig) {
|
||||
let match = helpers.inlineCommentRe.exec(line);
|
||||
if (match) {
|
||||
enabledRules = helpers.clone(enabledRules);
|
||||
enabledRules = { ...enabledRules };
|
||||
while (match) {
|
||||
forMatch(match);
|
||||
match = helpers.inlineCommentRe.exec(line);
|
||||
|
|
@ -613,7 +613,10 @@ function readConfig(file, parsers, callback) {
|
|||
if (errr) {
|
||||
return callback(errr);
|
||||
}
|
||||
return callback(null, helpers.assign(extendsConfig, config));
|
||||
return callback(null, {
|
||||
...extendsConfig,
|
||||
...config
|
||||
});
|
||||
});
|
||||
}
|
||||
return callback(null, config);
|
||||
|
|
@ -639,9 +642,13 @@ function readConfigSync(file, parsers) {
|
|||
const configExtends = config.extends;
|
||||
if (configExtends) {
|
||||
delete config.extends;
|
||||
return helpers.assign(
|
||||
readConfigSync(path.resolve(path.dirname(file), configExtends), parsers),
|
||||
config);
|
||||
return {
|
||||
...readConfigSync(
|
||||
path.resolve(path.dirname(file), configExtends),
|
||||
parsers
|
||||
),
|
||||
...config
|
||||
};
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue