markdownlint 0.28.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/demo/markdownlint-browser.js +52 -21
- package/lib/constants.js +1 -1
- package/lib/markdownlint.d.ts +11 -0
- package/lib/markdownlint.js +60 -29
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! markdownlint 0.28.
|
|
1
|
+
/*! markdownlint 0.28.1 https://github.com/DavidAnson/markdownlint @license MIT */
|
|
2
2
|
var markdownlint;
|
|
3
3
|
/******/ (() => { // webpackBootstrap
|
|
4
4
|
/******/ var __webpack_modules__ = ({
|
|
@@ -1636,7 +1636,7 @@ module.exports.referenceLinkImageData = function () {
|
|
|
1636
1636
|
module.exports.deprecatedRuleNames = ["MD002", "MD006"];
|
|
1637
1637
|
module.exports.fixableRuleNames = ["MD004", "MD005", "MD006", "MD007", "MD009", "MD010", "MD011", "MD012", "MD014", "MD018", "MD019", "MD020", "MD021", "MD022", "MD023", "MD026", "MD027", "MD030", "MD031", "MD032", "MD034", "MD037", "MD038", "MD039", "MD044", "MD047", "MD049", "MD050", "MD051", "MD053"];
|
|
1638
1638
|
module.exports.homepage = "https://github.com/DavidAnson/markdownlint";
|
|
1639
|
-
module.exports.version = "0.28.
|
|
1639
|
+
module.exports.version = "0.28.1";
|
|
1640
1640
|
|
|
1641
1641
|
/***/ }),
|
|
1642
1642
|
|
|
@@ -2828,6 +2828,53 @@ function resolveConfigExtendsSync(configFile, referenceId, fs) {
|
|
|
2828
2828
|
return resolvedExtendsFile;
|
|
2829
2829
|
}
|
|
2830
2830
|
|
|
2831
|
+
/**
|
|
2832
|
+
* Extend specified configuration object.
|
|
2833
|
+
*
|
|
2834
|
+
* @param {Configuration} config Configuration object.
|
|
2835
|
+
* @param {string} file Configuration file name.
|
|
2836
|
+
* @param {ConfigurationParser[]} parsers Parsing
|
|
2837
|
+
* function(s).
|
|
2838
|
+
* @param {Object} fs File system implementation.
|
|
2839
|
+
* @param {ReadConfigCallback} callback Callback (err, result) function.
|
|
2840
|
+
* @returns {void}
|
|
2841
|
+
*/
|
|
2842
|
+
function extendConfig(config, file, parsers, fs, callback) {
|
|
2843
|
+
var configExtends = config["extends"];
|
|
2844
|
+
if (configExtends) {
|
|
2845
|
+
return resolveConfigExtends(file, helpers.expandTildePath(configExtends, __webpack_require__(/*! node:os */ "?e6c4")), fs,
|
|
2846
|
+
// eslint-disable-next-line no-use-before-define
|
|
2847
|
+
function (_, resolvedExtends) {
|
|
2848
|
+
return readConfig(
|
|
2849
|
+
// @ts-ignore
|
|
2850
|
+
resolvedExtends, parsers, fs, function (err, extendsConfig) {
|
|
2851
|
+
if (err) {
|
|
2852
|
+
return callback(err);
|
|
2853
|
+
}
|
|
2854
|
+
var result = _objectSpread(_objectSpread({}, extendsConfig), config);
|
|
2855
|
+
delete result["extends"];
|
|
2856
|
+
return callback(null, result);
|
|
2857
|
+
});
|
|
2858
|
+
});
|
|
2859
|
+
}
|
|
2860
|
+
return callback(null, config);
|
|
2861
|
+
}
|
|
2862
|
+
var extendConfigPromisify = promisify && promisify(extendConfig);
|
|
2863
|
+
|
|
2864
|
+
/**
|
|
2865
|
+
* Extend specified configuration object.
|
|
2866
|
+
*
|
|
2867
|
+
* @param {Configuration} config Configuration object.
|
|
2868
|
+
* @param {string} file Configuration file name.
|
|
2869
|
+
* @param {ConfigurationParser[]} [parsers] Parsing function(s).
|
|
2870
|
+
* @param {Object} [fs] File system implementation.
|
|
2871
|
+
* @returns {Promise<Configuration>} Configuration object.
|
|
2872
|
+
*/
|
|
2873
|
+
function extendConfigPromise(config, file, parsers, fs) {
|
|
2874
|
+
// @ts-ignore
|
|
2875
|
+
return extendConfigPromisify(config, file, parsers, fs);
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2831
2878
|
/**
|
|
2832
2879
|
* Read specified configuration file.
|
|
2833
2880
|
*
|
|
@@ -2854,8 +2901,7 @@ function readConfig(file, parsers, fs, callback) {
|
|
|
2854
2901
|
fs = __webpack_require__(/*! node:fs */ "?d0ee");
|
|
2855
2902
|
}
|
|
2856
2903
|
// Read file
|
|
2857
|
-
|
|
2858
|
-
file = helpers.expandTildePath(file, os);
|
|
2904
|
+
file = helpers.expandTildePath(file, __webpack_require__(/*! node:os */ "?e6c4"));
|
|
2859
2905
|
fs.readFile(file, "utf8", function (err, content) {
|
|
2860
2906
|
if (err) {
|
|
2861
2907
|
// @ts-ignore
|
|
@@ -2871,24 +2917,8 @@ function readConfig(file, parsers, fs, callback) {
|
|
|
2871
2917
|
return callback(new Error(message));
|
|
2872
2918
|
}
|
|
2873
2919
|
// Extend configuration
|
|
2874
|
-
var configExtends = config["extends"];
|
|
2875
|
-
if (configExtends) {
|
|
2876
|
-
delete config["extends"];
|
|
2877
|
-
return resolveConfigExtends(file, helpers.expandTildePath(configExtends, os), fs, function (_, resolvedExtends) {
|
|
2878
|
-
return readConfig(
|
|
2879
|
-
// @ts-ignore
|
|
2880
|
-
resolvedExtends, parsers, fs, function (errr, extendsConfig) {
|
|
2881
|
-
if (errr) {
|
|
2882
|
-
// @ts-ignore
|
|
2883
|
-
return callback(errr);
|
|
2884
|
-
}
|
|
2885
|
-
// @ts-ignore
|
|
2886
|
-
return callback(null, _objectSpread(_objectSpread({}, extendsConfig), config));
|
|
2887
|
-
});
|
|
2888
|
-
});
|
|
2889
|
-
}
|
|
2890
2920
|
// @ts-ignore
|
|
2891
|
-
return
|
|
2921
|
+
return extendConfig(config, file, parsers, fs, callback);
|
|
2892
2922
|
});
|
|
2893
2923
|
}
|
|
2894
2924
|
var readConfigPromisify = promisify && promisify(readConfig);
|
|
@@ -2956,6 +2986,7 @@ markdownlint.readConfigSync = readConfigSync;
|
|
|
2956
2986
|
markdownlint.getVersion = getVersion;
|
|
2957
2987
|
markdownlint.promises = {
|
|
2958
2988
|
"markdownlint": markdownlintPromise,
|
|
2989
|
+
"extendConfig": extendConfigPromise,
|
|
2959
2990
|
"readConfig": readConfigPromise
|
|
2960
2991
|
};
|
|
2961
2992
|
module.exports = markdownlint;
|
package/lib/constants.js
CHANGED
package/lib/markdownlint.d.ts
CHANGED
|
@@ -101,6 +101,7 @@ declare function readConfigSync(file: string, parsers?: ConfigurationParser[], f
|
|
|
101
101
|
declare function getVersion(): string;
|
|
102
102
|
declare namespace promises {
|
|
103
103
|
export { markdownlintPromise as markdownlint };
|
|
104
|
+
export { extendConfigPromise as extendConfig };
|
|
104
105
|
export { readConfigPromise as readConfig };
|
|
105
106
|
}
|
|
106
107
|
/**
|
|
@@ -378,6 +379,16 @@ type ResolveConfigExtendsCallback = (err: Error | null, path?: string) => void;
|
|
|
378
379
|
* @returns {Promise<LintResults>} Results object.
|
|
379
380
|
*/
|
|
380
381
|
declare function markdownlintPromise(options: Options): Promise<LintResults>;
|
|
382
|
+
/**
|
|
383
|
+
* Extend specified configuration object.
|
|
384
|
+
*
|
|
385
|
+
* @param {Configuration} config Configuration object.
|
|
386
|
+
* @param {string} file Configuration file name.
|
|
387
|
+
* @param {ConfigurationParser[]} [parsers] Parsing function(s).
|
|
388
|
+
* @param {Object} [fs] File system implementation.
|
|
389
|
+
* @returns {Promise<Configuration>} Configuration object.
|
|
390
|
+
*/
|
|
391
|
+
declare function extendConfigPromise(config: Configuration, file: string, parsers?: ConfigurationParser[], fs?: any): Promise<Configuration>;
|
|
381
392
|
/**
|
|
382
393
|
* Read specified configuration file.
|
|
383
394
|
*
|
package/lib/markdownlint.js
CHANGED
|
@@ -1079,6 +1079,63 @@ function resolveConfigExtendsSync(configFile, referenceId, fs) {
|
|
|
1079
1079
|
return resolvedExtendsFile;
|
|
1080
1080
|
}
|
|
1081
1081
|
|
|
1082
|
+
/**
|
|
1083
|
+
* Extend specified configuration object.
|
|
1084
|
+
*
|
|
1085
|
+
* @param {Configuration} config Configuration object.
|
|
1086
|
+
* @param {string} file Configuration file name.
|
|
1087
|
+
* @param {ConfigurationParser[]} parsers Parsing
|
|
1088
|
+
* function(s).
|
|
1089
|
+
* @param {Object} fs File system implementation.
|
|
1090
|
+
* @param {ReadConfigCallback} callback Callback (err, result) function.
|
|
1091
|
+
* @returns {void}
|
|
1092
|
+
*/
|
|
1093
|
+
function extendConfig(config, file, parsers, fs, callback) {
|
|
1094
|
+
const configExtends = config.extends;
|
|
1095
|
+
if (configExtends) {
|
|
1096
|
+
return resolveConfigExtends(
|
|
1097
|
+
file,
|
|
1098
|
+
helpers.expandTildePath(configExtends, require("node:os")),
|
|
1099
|
+
fs,
|
|
1100
|
+
// eslint-disable-next-line no-use-before-define
|
|
1101
|
+
(_, resolvedExtends) => readConfig(
|
|
1102
|
+
// @ts-ignore
|
|
1103
|
+
resolvedExtends,
|
|
1104
|
+
parsers,
|
|
1105
|
+
fs,
|
|
1106
|
+
(err, extendsConfig) => {
|
|
1107
|
+
if (err) {
|
|
1108
|
+
return callback(err);
|
|
1109
|
+
}
|
|
1110
|
+
const result = {
|
|
1111
|
+
...extendsConfig,
|
|
1112
|
+
...config
|
|
1113
|
+
};
|
|
1114
|
+
delete result.extends;
|
|
1115
|
+
return callback(null, result);
|
|
1116
|
+
}
|
|
1117
|
+
)
|
|
1118
|
+
);
|
|
1119
|
+
}
|
|
1120
|
+
return callback(null, config);
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
const extendConfigPromisify = promisify && promisify(extendConfig);
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* Extend specified configuration object.
|
|
1127
|
+
*
|
|
1128
|
+
* @param {Configuration} config Configuration object.
|
|
1129
|
+
* @param {string} file Configuration file name.
|
|
1130
|
+
* @param {ConfigurationParser[]} [parsers] Parsing function(s).
|
|
1131
|
+
* @param {Object} [fs] File system implementation.
|
|
1132
|
+
* @returns {Promise<Configuration>} Configuration object.
|
|
1133
|
+
*/
|
|
1134
|
+
function extendConfigPromise(config, file, parsers, fs) {
|
|
1135
|
+
// @ts-ignore
|
|
1136
|
+
return extendConfigPromisify(config, file, parsers, fs);
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1082
1139
|
/**
|
|
1083
1140
|
* Read specified configuration file.
|
|
1084
1141
|
*
|
|
@@ -1105,8 +1162,7 @@ function readConfig(file, parsers, fs, callback) {
|
|
|
1105
1162
|
fs = require("node:fs");
|
|
1106
1163
|
}
|
|
1107
1164
|
// Read file
|
|
1108
|
-
|
|
1109
|
-
file = helpers.expandTildePath(file, os);
|
|
1165
|
+
file = helpers.expandTildePath(file, require("node:os"));
|
|
1110
1166
|
fs.readFile(file, "utf8", (err, content) => {
|
|
1111
1167
|
if (err) {
|
|
1112
1168
|
// @ts-ignore
|
|
@@ -1120,34 +1176,8 @@ function readConfig(file, parsers, fs, callback) {
|
|
|
1120
1176
|
return callback(new Error(message));
|
|
1121
1177
|
}
|
|
1122
1178
|
// Extend configuration
|
|
1123
|
-
const configExtends = config.extends;
|
|
1124
|
-
if (configExtends) {
|
|
1125
|
-
delete config.extends;
|
|
1126
|
-
return resolveConfigExtends(
|
|
1127
|
-
file,
|
|
1128
|
-
helpers.expandTildePath(configExtends, os),
|
|
1129
|
-
fs,
|
|
1130
|
-
(_, resolvedExtends) => readConfig(
|
|
1131
|
-
// @ts-ignore
|
|
1132
|
-
resolvedExtends,
|
|
1133
|
-
parsers,
|
|
1134
|
-
fs,
|
|
1135
|
-
(errr, extendsConfig) => {
|
|
1136
|
-
if (errr) {
|
|
1137
|
-
// @ts-ignore
|
|
1138
|
-
return callback(errr);
|
|
1139
|
-
}
|
|
1140
|
-
// @ts-ignore
|
|
1141
|
-
return callback(null, {
|
|
1142
|
-
...extendsConfig,
|
|
1143
|
-
...config
|
|
1144
|
-
});
|
|
1145
|
-
}
|
|
1146
|
-
)
|
|
1147
|
-
);
|
|
1148
|
-
}
|
|
1149
1179
|
// @ts-ignore
|
|
1150
|
-
return
|
|
1180
|
+
return extendConfig(config, file, parsers, fs, callback);
|
|
1151
1181
|
});
|
|
1152
1182
|
}
|
|
1153
1183
|
|
|
@@ -1221,6 +1251,7 @@ markdownlint.readConfigSync = readConfigSync;
|
|
|
1221
1251
|
markdownlint.getVersion = getVersion;
|
|
1222
1252
|
markdownlint.promises = {
|
|
1223
1253
|
"markdownlint": markdownlintPromise,
|
|
1254
|
+
"extendConfig": extendConfigPromise,
|
|
1224
1255
|
"readConfig": readConfigPromise
|
|
1225
1256
|
};
|
|
1226
1257
|
module.exports = markdownlint;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdownlint",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.1",
|
|
4
4
|
"description": "A Node.js style checker and lint tool for Markdown/CommonMark files.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./lib/markdownlint.js",
|
|
@@ -69,14 +69,14 @@
|
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"ava": "5.2.0",
|
|
71
71
|
"babel-loader": "9.1.2",
|
|
72
|
-
"@babel/core": "7.21.
|
|
73
|
-
"@babel/preset-env": "7.
|
|
72
|
+
"@babel/core": "7.21.4",
|
|
73
|
+
"@babel/preset-env": "7.21.4",
|
|
74
74
|
"c8": "7.13.0",
|
|
75
|
-
"eslint": "8.
|
|
75
|
+
"eslint": "8.37.0",
|
|
76
76
|
"eslint-plugin-es": "4.1.0",
|
|
77
|
-
"eslint-plugin-jsdoc": "40.1.
|
|
78
|
-
"eslint-plugin-n": "15.
|
|
79
|
-
"eslint-plugin-regexp": "1.
|
|
77
|
+
"eslint-plugin-jsdoc": "40.1.1",
|
|
78
|
+
"eslint-plugin-n": "15.7.0",
|
|
79
|
+
"eslint-plugin-regexp": "1.14.0",
|
|
80
80
|
"eslint-plugin-unicorn": "46.0.0",
|
|
81
81
|
"globby": "13.1.3",
|
|
82
82
|
"js-yaml": "4.1.0",
|
|
@@ -84,14 +84,14 @@
|
|
|
84
84
|
"markdown-it-sub": "1.0.0",
|
|
85
85
|
"markdown-it-sup": "1.0.0",
|
|
86
86
|
"markdown-it-texmath": "1.0.0",
|
|
87
|
-
"markdownlint-rule-helpers": "0.
|
|
87
|
+
"markdownlint-rule-helpers": "0.19.0",
|
|
88
88
|
"npm-run-all": "4.1.5",
|
|
89
89
|
"strip-json-comments": "5.0.0",
|
|
90
90
|
"terser-webpack-plugin": "5.3.7",
|
|
91
91
|
"toml": "3.0.0",
|
|
92
92
|
"tv4": "1.3.0",
|
|
93
|
-
"typescript": "5.0.
|
|
94
|
-
"webpack": "5.
|
|
93
|
+
"typescript": "5.0.3",
|
|
94
|
+
"webpack": "5.77.0",
|
|
95
95
|
"webpack-cli": "5.0.1",
|
|
96
96
|
"yaml": "2.2.1"
|
|
97
97
|
},
|