From e4640fec967b8a75d791f4c0274f347896540408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Mon, 26 Sep 2016 11:49:42 +0300 Subject: [PATCH] no-file-name-articles: forbid `teh` It is sometimes used as an alternative to "the", so `no-file-name-articles` rule should also forbid it. Closes GH-100. --- doc/rules.md | 6 ++++++ packages/remark-lint/lib/rules/no-file-name-articles.js | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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] + '`');