Skip to content

Commit

Permalink
ci: use yamlModule
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnAngela committed Mar 8, 2024
1 parent c368cf3 commit bdf04e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fs from "node:fs";
import path from "node:path";
import YAML from "yaml";
import yamlModule from "./scripts/modules/yamlModule.js";
import { configs } from "@annangela/eslint-config";
import readDir from "./scripts/modules/readDir.js";

Expand All @@ -17,7 +16,7 @@ const ignores = [
const srcESlintrcFiles = (await readDir("./src")).filter((n) => path.basename(n) === ".eslintrc.yaml");
for (const srcESlintrcFile of srcESlintrcFiles) {
const dir = path.dirname(srcESlintrcFile);
const srcESlintrc = YAML.parse(await fs.promises.readFile(srcESlintrcFile, { encoding: "utf-8" }));
const srcESlintrc = await yamlModule.readFile(srcESlintrcFile);
if (Array.isArray(srcESlintrc.ignorePatterns)) {
for (const ignorePattern of srcESlintrc.ignorePatterns) {
ignores.push(path.join(dir, ignorePattern));
Expand Down
5 changes: 2 additions & 3 deletions scripts/modules/octokit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import console from "../modules/console.js";
import fs from "fs";
import yaml from "yaml";
const { assignees } = yaml.parse(await fs.promises.readFile(".github/auto_assign.yaml", { encoding: "utf-8" }));
import yamlModule from "../modules/yamlModule.js";
const { assignees } = await yamlModule.readFile(".github/auto_assign.yaml");
import { startGroup, endGroup } from "@actions/core";
import { Octokit } from "@octokit/rest";
import { retry } from "@octokit/plugin-retry";
Expand Down

0 comments on commit bdf04e9

Please sign in to comment.