mirror of
https://github.com/sasjs/lint.git
synced 2026-01-07 20:50:04 +00:00
feat: add new config maxDataLineLength
This commit is contained in:
@@ -35,6 +35,7 @@ export class LintConfig {
|
||||
readonly pathLintRules: PathLintRule[] = []
|
||||
readonly maxLineLength: number = 80
|
||||
readonly maxHeaderLineLength: number = 80
|
||||
readonly maxDataLineLength: number = 80
|
||||
readonly indentationMultiple: number = 2
|
||||
readonly lineEndings: LineEndings = LineEndings.LF
|
||||
readonly defaultHeader: string = getDefaultHeader()
|
||||
@@ -75,6 +76,10 @@ export class LintConfig {
|
||||
if (!isNaN(json?.maxHeaderLineLength)) {
|
||||
this.maxHeaderLineLength = json.maxHeaderLineLength
|
||||
}
|
||||
|
||||
if (!isNaN(json?.maxDataLineLength)) {
|
||||
this.maxDataLineLength = json.maxDataLineLength
|
||||
}
|
||||
}
|
||||
|
||||
this.fileLintRules.push(lineEndings)
|
||||
|
||||
@@ -13,6 +13,11 @@ export interface LintRule {
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface LineLintRuleOptions {
|
||||
isHeaderLine?: boolean
|
||||
isDataLine?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* A LineLintRule is run once per line of text.
|
||||
*/
|
||||
@@ -22,7 +27,7 @@ export interface LineLintRule extends LintRule {
|
||||
value: string,
|
||||
lineNumber: number,
|
||||
config?: LintConfig,
|
||||
isHeaderLine?: boolean
|
||||
options?: LineLintRuleOptions
|
||||
) => Diagnostic[]
|
||||
fix?: (value: string, config?: LintConfig) => string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user