-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
26 lines (24 loc) · 800 Bytes
/
index.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
var analyze = require('commonform-analyze')
var rules = [
require('./rules/specific/broken-references'),
require('./rules/specific/duplicate-definitions'),
require('./rules/specific/duplicate-headings'),
require('./rules/specific/undefined-terms'),
require('./rules/specific/unused-terms'),
require('./rules/specific/terms-used-once'),
require('./rules/specific/unmarked-terms'),
require('./rules/specific/unmarked-references')
]
module.exports = function (form) {
var analysis = analyze(form)
return rules.reduce(function (annotations, rule) {
return annotations
.concat(
rule(form, analysis).map(function (annotation) {
annotation.source = 'commonform-lint'
annotation.url = null
return annotation
})
)
}, [])
}