-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closed #54
- Loading branch information
Showing
17 changed files
with
103 additions
and
831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,6 @@ | ||
import ensureTense from '../library/ensure-tense'; | ||
import message from '../library/message'; | ||
|
||
export default (parsed, when, value) => { | ||
const tenses = Array.isArray(value) ? value : value.allowed || []; | ||
const ignoreConfig = Array.isArray(value) ? [] : value.ignored || []; | ||
|
||
const negated = when === 'never'; | ||
const ignored = [...ignoreConfig, ...parsed.notes.map(note => note.title)]; | ||
const {matches, offending} = ensureTense(parsed.body, tenses, {ignored}); | ||
const offenders = offending | ||
.map(item => [item.lemma, item.tense].join(' - ')) | ||
.join(','); | ||
|
||
return [ | ||
negated ? !matches : matches, | ||
message([ | ||
`tense of body must`, | ||
negated ? `not` : null, | ||
`be ${value}. Verbs in other tenses: ${offenders}` | ||
]) | ||
false, | ||
`rules.body-tense is deprecated. Received [${when}, [${value.join(', ')}]]` | ||
]; | ||
}; |
Oops, something went wrong.