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.
This commit is contained in:
Сковорода Никита Андреевич 2016-09-26 11:49:42 +03:00 committed by Titus Wormer
parent 3b11ff4a34
commit e4640fec96
2 changed files with 11 additions and 1 deletions

View File

@ -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`
```

View File

@ -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] + '`');