From ec907567e2b76feaeaba0cee55acbfc155f58461 Mon Sep 17 00:00:00 2001 From: David Anson Date: Sat, 6 Feb 2021 19:23:55 -0800 Subject: [PATCH] Update dependencies: c8 to 7.5.0, eslint to 7.19.0, globby to 11.0.2, js-yaml to 4.0.0, markdownlint-rule-helpers to 0.13.0, ts-loader to 8.0.15, typescript to 4.1.3, webpack to 5.21.1, webpack-cli to 4.5.0. --- README.md | 2 +- demo/markdownlint-browser.js | 6 +++--- package.json | 18 +++++++++--------- test/markdownlint-test-repos.js | 2 +- test/markdownlint-test.js | 22 +++++++++++----------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 4db7818c..cfeb0744 100644 --- a/README.md +++ b/README.md @@ -625,7 +625,7 @@ should come before flexible parsers. For example: ```js -[ JSON.parse, require("toml").parse, require("js-yaml").safeLoad ] +[ JSON.parse, require("toml").parse, require("js-yaml").load ] ``` #### callback diff --git a/demo/markdownlint-browser.js b/demo/markdownlint-browser.js index 89952501..035ceb2c 100644 --- a/demo/markdownlint-browser.js +++ b/demo/markdownlint-browser.js @@ -14,7 +14,7 @@ function webpackEmptyContext(req) { e.code = 'MODULE_NOT_FOUND'; throw e; } -webpackEmptyContext.keys = () => []; +webpackEmptyContext.keys = () => ([]); webpackEmptyContext.resolve = webpackEmptyContext; webpackEmptyContext.id = "../lib sync recursive"; module.exports = webpackEmptyContext; @@ -4014,7 +4014,7 @@ module.exports = rules; /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"name\":\"markdownlint\",\"version\":\"0.22.0\",\"description\":\"A Node.js style checker and lint tool for Markdown/CommonMark files.\",\"main\":\"lib/markdownlint.js\",\"types\":\"lib/markdownlint.d.ts\",\"author\":\"David Anson (https://dlaa.me/)\",\"license\":\"MIT\",\"homepage\":\"https://github.com/DavidAnson/markdownlint\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/DavidAnson/markdownlint.git\"},\"bugs\":\"https://github.com/DavidAnson/markdownlint/issues\",\"scripts\":{\"build-config\":\"npm run build-config-schema && npm run build-config-example\",\"build-config-example\":\"node schema/build-config-example.js\",\"build-config-schema\":\"node schema/build-config-schema.js\",\"build-declaration\":\"tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'\",\"build-demo\":\"cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && webpack --no-stats\",\"build-example\":\"npm install --no-save --ignore-scripts grunt grunt-cli gulp through2\",\"ci\":\"npm-run-all --continue-on-error --parallel test-cover lint declaration build-config build-demo && git diff --exit-code\",\"clean-test-repos\":\"rimraf test-repos\",\"clone-test-repos\":\"mkdir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet\",\"clone-test-repos-large\":\"npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet\",\"declaration\":\"npm run build-declaration && npm run test-declaration\",\"example\":\"cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint\",\"lint\":\"eslint --max-warnings 0 .\",\"lint-test-repos\":\"ava --timeout=5m test/markdownlint-test-repos.js\",\"test\":\"ava test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js\",\"test-cover\":\"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test\",\"test-declaration\":\"cd example/typescript && tsc && node type-check.js\",\"test-extra\":\"ava --timeout=5m test/markdownlint-test-extra.js\"},\"engines\":{\"node\":\">=10\"},\"dependencies\":{\"markdown-it\":\"12.0.4\"},\"devDependencies\":{\"ava\":\"~3.15.0\",\"c8\":\"~7.3.5\",\"cpy-cli\":\"~3.1.1\",\"eslint\":\"~7.14.0\",\"eslint-plugin-jsdoc\":\"~30.7.8\",\"eslint-plugin-node\":\"~11.1.0\",\"eslint-plugin-unicorn\":\"~23.0.0\",\"globby\":\"~11.0.1\",\"js-yaml\":\"~3.14.0\",\"markdown-it-for-inline\":\"~0.1.1\",\"markdown-it-sub\":\"~1.0.0\",\"markdown-it-sup\":\"~1.0.0\",\"markdown-it-texmath\":\"~0.8.0\",\"markdownlint-rule-helpers\":\"~0.12.0\",\"npm-run-all\":\"~4.1.5\",\"rimraf\":\"~3.0.2\",\"strip-json-comments\":\"~3.1.1\",\"toml\":\"~3.0.0\",\"ts-loader\":\"~8.0.14\",\"tv4\":\"~1.3.0\",\"typescript\":\"~4.1.2\",\"webpack\":\"~5.11.1\",\"webpack-cli\":\"~4.3.1\"},\"keywords\":[\"markdown\",\"lint\",\"md\",\"CommonMark\",\"markdownlint\"]}"); +module.exports = JSON.parse("{\"name\":\"markdownlint\",\"version\":\"0.22.0\",\"description\":\"A Node.js style checker and lint tool for Markdown/CommonMark files.\",\"main\":\"lib/markdownlint.js\",\"types\":\"lib/markdownlint.d.ts\",\"author\":\"David Anson (https://dlaa.me/)\",\"license\":\"MIT\",\"homepage\":\"https://github.com/DavidAnson/markdownlint\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/DavidAnson/markdownlint.git\"},\"bugs\":\"https://github.com/DavidAnson/markdownlint/issues\",\"scripts\":{\"build-config\":\"npm run build-config-schema && npm run build-config-example\",\"build-config-example\":\"node schema/build-config-example.js\",\"build-config-schema\":\"node schema/build-config-schema.js\",\"build-declaration\":\"tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'\",\"build-demo\":\"cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && webpack --no-stats\",\"build-example\":\"npm install --no-save --ignore-scripts grunt grunt-cli gulp through2\",\"ci\":\"npm-run-all --continue-on-error --parallel test-cover lint declaration build-config build-demo && git diff --exit-code\",\"clean-test-repos\":\"rimraf test-repos\",\"clone-test-repos\":\"mkdir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet\",\"clone-test-repos-large\":\"npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet\",\"declaration\":\"npm run build-declaration && npm run test-declaration\",\"example\":\"cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint\",\"lint\":\"eslint --max-warnings 0 .\",\"lint-test-repos\":\"ava --timeout=5m test/markdownlint-test-repos.js\",\"test\":\"ava test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js\",\"test-cover\":\"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test\",\"test-declaration\":\"cd example/typescript && tsc && node type-check.js\",\"test-extra\":\"ava --timeout=5m test/markdownlint-test-extra.js\"},\"engines\":{\"node\":\">=10\"},\"dependencies\":{\"markdown-it\":\"12.0.4\"},\"devDependencies\":{\"ava\":\"~3.15.0\",\"c8\":\"~7.5.0\",\"cpy-cli\":\"~3.1.1\",\"eslint\":\"~7.19.0\",\"eslint-plugin-jsdoc\":\"~30.7.8\",\"eslint-plugin-node\":\"~11.1.0\",\"eslint-plugin-unicorn\":\"~23.0.0\",\"globby\":\"~11.0.2\",\"js-yaml\":\"~4.0.0\",\"markdown-it-for-inline\":\"~0.1.1\",\"markdown-it-sub\":\"~1.0.0\",\"markdown-it-sup\":\"~1.0.0\",\"markdown-it-texmath\":\"~0.8.0\",\"markdownlint-rule-helpers\":\"~0.13.0\",\"npm-run-all\":\"~4.1.5\",\"rimraf\":\"~3.0.2\",\"strip-json-comments\":\"~3.1.1\",\"toml\":\"~3.0.0\",\"ts-loader\":\"~8.0.15\",\"tv4\":\"~1.3.0\",\"typescript\":\"~4.1.3\",\"webpack\":\"~5.21.1\",\"webpack-cli\":\"~4.5.0\"},\"keywords\":[\"markdown\",\"lint\",\"md\",\"CommonMark\",\"markdownlint\"]}"); /***/ }), @@ -4097,7 +4097,7 @@ module.exports = markdownit; /************************************************************************/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ diff --git a/package.json b/package.json index b9c88546..eae1fa00 100644 --- a/package.json +++ b/package.json @@ -40,28 +40,28 @@ }, "devDependencies": { "ava": "~3.15.0", - "c8": "~7.3.5", + "c8": "~7.5.0", "cpy-cli": "~3.1.1", - "eslint": "~7.14.0", + "eslint": "~7.19.0", "eslint-plugin-jsdoc": "~30.7.8", "eslint-plugin-node": "~11.1.0", "eslint-plugin-unicorn": "~23.0.0", - "globby": "~11.0.1", - "js-yaml": "~3.14.0", + "globby": "~11.0.2", + "js-yaml": "~4.0.0", "markdown-it-for-inline": "~0.1.1", "markdown-it-sub": "~1.0.0", "markdown-it-sup": "~1.0.0", "markdown-it-texmath": "~0.8.0", - "markdownlint-rule-helpers": "~0.12.0", + "markdownlint-rule-helpers": "~0.13.0", "npm-run-all": "~4.1.5", "rimraf": "~3.0.2", "strip-json-comments": "~3.1.1", "toml": "~3.0.0", - "ts-loader": "~8.0.14", + "ts-loader": "~8.0.15", "tv4": "~1.3.0", - "typescript": "~4.1.2", - "webpack": "~5.11.1", - "webpack-cli": "~4.3.1" + "typescript": "~4.1.3", + "webpack": "~5.21.1", + "webpack-cli": "~4.5.0" }, "keywords": [ "markdown", diff --git a/test/markdownlint-test-repos.js b/test/markdownlint-test-repos.js index 1263d29e..f331c37a 100644 --- a/test/markdownlint-test-repos.js +++ b/test/markdownlint-test-repos.js @@ -31,7 +31,7 @@ function jsoncParse(json) { * @returns {Object} Object representation. */ function yamlParse(yaml) { - return jsYaml.safeLoad(yaml); + return jsYaml.load(yaml); } /** diff --git a/test/markdownlint-test.js b/test/markdownlint-test.js index 670dfbfb..3c654ca0 100644 --- a/test/markdownlint-test.js +++ b/test/markdownlint-test.js @@ -1028,7 +1028,7 @@ test("validateConfigExampleJson", (t) => { path.join(__dirname, "../schema", fileYaml), "utf8" ); - const yamlObject = jsYaml.safeLoad(dataYaml); + const yamlObject = jsYaml.load(dataYaml); t.deepEqual(yamlObject, jsonObject, "YAML example does not match JSON example."); }); @@ -1154,7 +1154,7 @@ test.cb("configSingleYaml", (t) => { markdownlint.readConfig( "./test/config/config-child.yaml", // @ts-ignore - [ require("js-yaml").safeLoad ], + [ require("js-yaml").load ], function callback(err, actual) { t.falsy(err); const expected = require("./config/config-child.json"); @@ -1168,7 +1168,7 @@ test.cb("configMultipleYaml", (t) => { markdownlint.readConfig( "./test/config/config-grandparent.yaml", // @ts-ignore - [ require("js-yaml").safeLoad ], + [ require("js-yaml").load ], function callback(err, actual) { t.falsy(err); const expected = { @@ -1187,7 +1187,7 @@ test.cb("configMultipleHybrid", (t) => { markdownlint.readConfig( "./test/config/config-grandparent-hybrid.yaml", // @ts-ignore - [ JSON.parse, require("toml").parse, require("js-yaml").safeLoad ], + [ JSON.parse, require("toml").parse, require("js-yaml").load ], function callback(err, actual) { t.falsy(err); const expected = { @@ -1206,13 +1206,13 @@ test.cb("configBadHybrid", (t) => { markdownlint.readConfig( "./test/config/config-badcontent.txt", // @ts-ignore - [ JSON.parse, require("toml").parse, require("js-yaml").safeLoad ], + [ JSON.parse, require("toml").parse, require("js-yaml").load ], function callback(err, result) { t.truthy(err, "Did not get an error for bad child JSON."); t.true(err instanceof Error, "Error not instance of Error."); t.truthy(err.message.match( // eslint-disable-next-line max-len - /^Unable to parse '[^']*'; Unexpected token \S+ in JSON at position \d+; Expected [^;]+ or end of input but "\S+" found.; end of the stream or a document separator is expected at line \d+, column \d+:[^;]*$/ + /^Unable to parse '[^']*'; Unexpected token \S+ in JSON at position \d+;/ ), "Error message unexpected."); t.true(!result, "Got result for bad child JSON."); t.end(); @@ -1305,7 +1305,7 @@ test("configSingleYamlSync", (t) => { t.plan(1); const actual = markdownlint.readConfigSync( // @ts-ignore - "./test/config/config-child.yaml", [ require("js-yaml").safeLoad ]); + "./test/config/config-child.yaml", [ require("js-yaml").load ]); const expected = require("./config/config-child.json"); t.deepEqual(actual, expected, "Config object not correct."); }); @@ -1314,7 +1314,7 @@ test("configMultipleYamlSync", (t) => { t.plan(1); const actual = markdownlint.readConfigSync( // @ts-ignore - "./test/config/config-grandparent.yaml", [ require("js-yaml").safeLoad ]); + "./test/config/config-grandparent.yaml", [ require("js-yaml").load ]); const expected = { ...require("./config/config-child.json"), ...require("./config/config-parent.json"), @@ -1329,7 +1329,7 @@ test("configMultipleHybridSync", (t) => { const actual = markdownlint.readConfigSync( "./test/config/config-grandparent-hybrid.yaml", // @ts-ignore - [ JSON.parse, require("toml").parse, require("js-yaml").safeLoad ]); + [ JSON.parse, require("toml").parse, require("js-yaml").load ]); const expected = { ...require("./config/config-child.json"), ...require("./config/config-parent.json"), @@ -1346,11 +1346,11 @@ test("configBadHybridSync", (t) => { markdownlint.readConfigSync( "./test/config/config-badcontent.txt", // @ts-ignore - [ JSON.parse, require("toml").parse, require("js-yaml").safeLoad ]); + [ JSON.parse, require("toml").parse, require("js-yaml").load ]); }, { // eslint-disable-next-line max-len - "message": /Unable to parse '[^']*'; Unexpected token \S+ in JSON at position \d+; Expected [^;]+ or end of input but "\S+" found.; end of the stream or a document separator is expected at line \d+, column \d+:[^;]*/ + "message": /^Unable to parse '[^']*'; Unexpected token \S+ in JSON at position \d+;/ }, "Did not get correct exception for bad content." );