1 | var lodash = require('lodash'),
|
2 | Linter = require('./linter');
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | var htmllint = function () {
|
9 | var linter = htmllint.defaultLinter;
|
10 |
|
11 | return linter.lint.apply(linter, arguments);
|
12 | };
|
13 |
|
14 | module.exports = htmllint;
|
15 |
|
16 | htmllint.Linter = Linter;
|
17 | htmllint.rules = require('./rules');
|
18 | htmllint.messages = require('./messages');
|
19 | htmllint.defaultLinter = new Linter(htmllint.rules);
|
20 |
|
21 | htmllint.use = function (plugins) {
|
22 | plugins.forEach(function (plugin) {
|
23 | if (lodash.isString(plugin)) {
|
24 | plugin = require(plugin);
|
25 | }
|
26 |
|
27 | htmllint.defaultLinter.use(plugin);
|
28 | });
|
29 | };
|