Skip to content

Commit

Permalink
change imports
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-mairose-sp committed Jun 4, 2024
1 parent 5befc50 commit 1ea2b27
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions functions/tag-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
// functionOptions:
// rule: 402

const fs = require("fs");
const yaml = require("yaml");
import { existsSync, readFileSync } from "fs";
import { parse } from "yaml";

module.exports = (targetVal, _opts, context) => {
export default (targetVal, _opts, context) => {
const { rule } = _opts;
let results = [];
let filePath = "";
Expand All @@ -29,11 +29,11 @@ module.exports = (targetVal, _opts, context) => {
}
}

if (fs.existsSync(filePath)) {
if (existsSync(filePath)) {
try {
// Read and parse the YAML file synchronously
const data = fs.readFileSync(filePath, 'utf8');
const parsedData = yaml.parse(data);
const data = readFileSync(filePath, 'utf8');
const parsedData = parse(data);
parsedData.tags.forEach((tag) => {
tagArray.push(tag.name);
});
Expand Down

0 comments on commit 1ea2b27

Please sign in to comment.