Skip to content

Commit

Permalink
chore: fix rule doc headers check (#16564)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Nov 21, 2022
1 parent 1ae9f20 commit f5808cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile.js
Expand Up @@ -15,6 +15,7 @@ const checker = require("npm-license"),
fs = require("fs"),
glob = require("glob"),
marked = require("marked"),
matter = require("gray-matter"),
markdownlint = require("markdownlint"),
os = require("os"),
path = require("path"),
Expand Down Expand Up @@ -707,7 +708,8 @@ target.checkRuleFiles = function() {
const basename = path.basename(filename, ".js");
const docFilename = `docs/src/rules/${basename}.md`;
const docText = cat(docFilename);
const docMarkdown = marked.lexer(docText, { gfm: true, silent: false });
const docTextWithoutFrontmatter = matter(String(docText)).content;
const docMarkdown = marked.lexer(docTextWithoutFrontmatter, { gfm: true, silent: false });
const ruleCode = cat(filename);
const knownHeaders = ["Rule Details", "Options", "Environments", "Examples", "Known Limitations", "When Not To Use It", "Compatibility"];

Expand Down

0 comments on commit f5808cb

Please sign in to comment.