feat: renamed files/folders to lowercase

This commit is contained in:
Randell Dawson
2018-11-22 07:13:47 -08:00
committed by mrugesh mohapatra
parent df73a08b4e
commit b8b14cb6dc
24 changed files with 101 additions and 28 deletions

View File

@@ -0,0 +1,23 @@
const matter = require('gray-matter');
const _ = require('lodash');
const dedent = require('dedent');
const frontmatterCheck = (fullPath, isTranslation, fileContent) => {
const { data: frontmatter } = matter(fileContent);
let errors = [];
if (!frontmatter || _.isEmpty(frontmatter) || !frontmatter.title) {
errors.push({
msg: `Misplaced or missing \`title\` keyword in the front matter block. Review the [style guide](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/docs/style-guide-for-guide-articles.md#title) for more details.`,
fullPath
});
}
if (isTranslation && !frontmatter.localeTitle) {
errors.push({
msg: `Missing \`localeTitle\` keyword in the front matter block. Review the [style guide](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/docs/style-guide-for-guide-articles.md#title) for more details.`,
fullPath
});
}
return errors;
};
module.exports = { frontmatterCheck };