Add support for authoring custom rules.

This commit is contained in:
David Anson 2018-02-25 16:04:13 -08:00
parent f24f98e146
commit 802c81f929
6 changed files with 375 additions and 97 deletions

18
test/rules/first-line.js Normal file
View file

@ -0,0 +1,18 @@
// @ts-check
"use strict";
module.exports = {
"names": [ "first-line" ],
"description": "Rule that reports an error for the first line",
"tags": [ "test" ],
"function": function rule(params, onError) {
// Unconditionally report an error for line 1
onError({
"lineNumber": 1,
"detail": null,
"context": null,
"range": null
});
}
};