forked from rowanmanning/joblint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
language.js
33 lines (28 loc) · 814 Bytes
/
language.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
module.exports = defineRules;
var swears = [
'bloody',
'bugger',
'cunt',
/fuck(?:er|ing)?/,
/piss(?:ing)?/,
'shit'
];
function defineRules (linter) {
// Swears
linter.addRule({
name: 'Profanity',
desc: 'While swearing in the workplace can be OK, you shouldn\'t be using profanity in a ' +
'job spec – it\'s unprofessional.',
test: function (spec, result) {
var swearMentions = spec.containsAnyOf(swears);
if (swearMentions.length > 0) {
result.addWarning(
'Swearing in a job spec isn\'t very professional',
swearMentions
);
result.addRecruiterFailPoints(swearMentions.length);
}
}
});
}