Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Upgrade: js-yaml to v4 (#14890)
  • Loading branch information
bmish committed Aug 10, 2021
1 parent cbc43da commit 88db3f5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Makefile.js
Expand Up @@ -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
];

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/cli-engine/formatters/tap.js
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/init/config-file.js
Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/init/config-file.js
Expand Up @@ -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`, () => {
Expand Down

0 comments on commit 88db3f5

Please sign in to comment.