forked from rowanmanning/joblint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbubble.js
More file actions
76 lines (69 loc) · 2.22 KB
/
bubble.js
File metadata and controls
76 lines (69 loc) · 2.22 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
'use strict';
module.exports = defineRules;
var bubbleJobTitles = [
/gurus?/,
/hero(:?es)/,
/ninjas?/,
/rock\s*stars?/,
/super\s*stars?/
];
var temptations = [
/ales?/,
/beers?/,
/brewskis?/,
'coffee',
'foosball',
/keg(?:erator)?s?/,
/lagers?/,
/nerf\s*guns?/,
/ping\s*pong?/,
/pints?/,
/pizzas?/,
/play\s*stations?/,
/pool\s*table|pool/,
/rock\s*walls?/,
'table football',
/table\s*tennis/,
/wiis?/,
/xbox(?:es|s)?/,
/massages?/
];
function defineRules (linter) {
// Job title fails
linter.addRule({
name: 'Job "Titles"',
desc: 'Referring to tech people as Ninjas or similar devalues the work that they do and ' +
'shows a lack of respect and professionalism. It\'s also rather cliched and can be ' +
'an immediate turn-off to many people.',
test: function (spec, result) {
var bubbleJobMentions = spec.containsAnyOf(bubbleJobTitles);
if (bubbleJobMentions.length > 0) {
result.addWarning(
'Tech people are not ninjas, rock stars, gurus or superstars',
bubbleJobMentions
);
result.addCultureFailPoints(bubbleJobMentions.length / 2);
result.addRealismFailPoints(1);
}
}
});
// Temptations
linter.addRule({
name: 'Hollow Benefits',
desc: 'Benefits such as "beer fridge" and "pool table" are not bad in themselves, but ' +
'their appearance in a job spec often disguises the fact that there are few real ' +
'benefits to working for a company. Be wary of these.',
test: function (spec, result) {
var temptationMentions = spec.containsAnyOf(temptations);
if (temptationMentions.length > 0) {
result.addWarning(
'Attempt to attract candidates with hollow benefits: ' +
temptationMentions.join(', '),
temptationMentions
);
result.addCultureFailPoints(1);
result.addRecruiterFailPoints(temptationMentions.length / 2);
}
}
});
}