Ver código fonte

Fix header linter (#234)

Justin Starry 9 meses atrás
pai
commit
bd04d780b5
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      .github/linter/customRules.ts

+ 4 - 4
.github/linter/customRules.ts

@@ -7,9 +7,9 @@ export const enforceHeaderStructure = {
   tags: ["structure"],
   function: function rule(params: RuleParams, onError: RuleOnError) {
     const string = params.frontMatterLines
-    .join("\n")
-    .trim()
-    .replace(/^-*$/gm, "")
+      .join("\n")
+      .trim()
+      .replace(/^-*$/gm, "")
 
     const frontMatter: any = yaml.load(string)
     if (!frontMatter) return
@@ -30,7 +30,7 @@ export const enforceHeaderStructure = {
 
     let tempHeadings = expectedHeadings;
 
-    while (index < expectedHeadings.length) {
+    while (index < filtered.length) {
       let token = filtered[index]
       tempHeadings = tempHeadings.filter(item => item !== token.line)