diff --git a/Makefile.js b/Makefile.js index b93697857c6..3ee1b4c1b4c 100644 --- a/Makefile.js +++ b/Makefile.js @@ -43,7 +43,7 @@ const { cat, cd, cp, echo, exec, exit, find, ls, mkdir, pwd, rm, test } = requir const PERF_MULTIPLIER = 13e6; const OPEN_SOURCE_LICENSES = [ - /MIT/u, /BSD/u, /Apache/u, /ISC/u, /WTF/u, /Public Domain/u, /LGPL/u + /MIT/u, /BSD/u, /Apache/u, /ISC/u, /WTF/u, /Public Domain/u, /LGPL/u, /Python/u ]; //------------------------------------------------------------------------------ @@ -214,7 +214,7 @@ function generateRuleIndexPage() { // `.rules` will be `undefined` if all rules in category are deprecated. categoriesData.categories = categoriesData.categories.filter(category => !!category.rules); - const output = yaml.safeDump(categoriesData, { sortKeys: true }); + const output = yaml.dump(categoriesData, { sortKeys: true }); output.to(outputFile); } @@ -390,7 +390,7 @@ function getFirstVersionOfDeletion(filePath) { * @private */ function lintMarkdown(files) { - const config = yaml.safeLoad(fs.readFileSync(path.join(__dirname, "./.markdownlint.yml"), "utf8")), + const config = yaml.load(fs.readFileSync(path.join(__dirname, "./.markdownlint.yml"), "utf8")), result = markdownlint.sync({ files, config, diff --git a/lib/cli-engine/formatters/tap.js b/lib/cli-engine/formatters/tap.js index 354872a0c92..e4148a3b392 100644 --- a/lib/cli-engine/formatters/tap.js +++ b/lib/cli-engine/formatters/tap.js @@ -31,7 +31,7 @@ function outputDiagnostics(diagnostic) { const prefix = " "; let output = `${prefix}---\n`; - output += prefix + yaml.safeDump(diagnostic).split("\n").join(`\n${prefix}`); + output += prefix + yaml.dump(diagnostic).split("\n").join(`\n${prefix}`); output += "...\n"; return output; } diff --git a/lib/init/config-file.js b/lib/init/config-file.js index 4c648ac0551..a51f92e1c48 100644 --- a/lib/init/config-file.js +++ b/lib/init/config-file.js @@ -63,7 +63,7 @@ function writeYAMLConfigFile(config, filePath) { // lazy load YAML to improve performance when not used const yaml = require("js-yaml"); - const content = yaml.safeDump(config, { sortKeys: true }); + const content = yaml.dump(config, { sortKeys: true }); fs.writeFileSync(filePath, content, "utf8"); } diff --git a/package.json b/package.json index f0cd1bf67b0..746d6cc7003 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", diff --git a/tests/lib/init/config-file.js b/tests/lib/init/config-file.js index e9fe62e2c30..50a9af1d507 100644 --- a/tests/lib/init/config-file.js +++ b/tests/lib/init/config-file.js @@ -60,8 +60,8 @@ describe("ConfigFile", () => { [ ["JavaScript", "foo.js", espree.parse], ["JSON", "bar.json", JSON.parse], - ["YAML", "foo.yaml", yaml.safeLoad], - ["YML", "foo.yml", yaml.safeLoad] + ["YAML", "foo.yaml", yaml.load], + ["YML", "foo.yml", yaml.load] ].forEach(([fileType, filename, validate]) => { it(`should write a file through fs when a ${fileType} path is passed`, () => {