diff --git a/doc/rules.md b/doc/rules.md index f33b7a16..9f245f0a 100644 --- a/doc/rules.md +++ b/doc/rules.md @@ -1460,6 +1460,12 @@ When turned on is passed in, the following error is given: When turned on is passed in, the following error is given: +```text +1:1: Do not start file names with `teh` +``` + +When turned on is passed in, the following error is given: + ```text 1:1: Do not start file names with `an` ``` diff --git a/packages/remark-lint/lib/rules/no-file-name-articles.js b/packages/remark-lint/lib/rules/no-file-name-articles.js index 7f790fcd..266c52e3 100644 --- a/packages/remark-lint/lib/rules/no-file-name-articles.js +++ b/packages/remark-lint/lib/rules/no-file-name-articles.js @@ -16,6 +16,10 @@ * * 1:1: Do not start file names with `the` * + * @example {"name": "teh-title.md", "label": "output", "config": {"positionless": true}} + * + * 1:1: Do not start file names with `teh` + * * @example {"name": "an-article.md", "label": "output", "config": {"positionless": true}} * * 1:1: Do not start file names with `an` @@ -33,7 +37,7 @@ module.exports = noFileNameArticles; * @param {File} file - Virtual file. */ function noFileNameArticles(ast, file) { - var match = file.stem && file.stem.match(/^(the|an?)\b/i); + var match = file.stem && file.stem.match(/^(the|teh|an?)\b/i); if (match) { file.message('Do not start file names with `' + match[0] + '`');