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:
@@ -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[]
|
||||
|
||||
Reference in New Issue
Block a user