1
0
mirror of https://github.com/sasjs/lint.git synced 2026-01-08 13:00:06 +00:00

chore(*): add PR template, add TSDoc comments

This commit is contained in:
Krishna Acondy
2021-03-22 20:36:19 +00:00
parent bf23963127
commit da528bb031
12 changed files with 77 additions and 1 deletions

View File

@@ -1,6 +1,10 @@
import { Diagnostic } from './Diagnostic'
import { LintRuleType } from './LintRuleType'
/**
* A lint rule is defined by a type, name, description, warning text and a test function.
* The test function produces a set of diagnostics when executed.
*/
export interface LintRule {
type: LintRuleType
name: string
@@ -9,10 +13,16 @@ export interface LintRule {
test: (value: string, lineNumber: number) => Diagnostic[]
}
/**
* A LineLintRule is run once per line of text.
*/
export interface LineLintRule extends LintRule {
type: LintRuleType.Line
}
/**
* A FileLintRule is run once per file.
*/
export interface FileLintRule extends LintRule {
type: LintRuleType.File
test: (value: string) => Diagnostic[]