mirror of
https://github.com/sasjs/lint.git
synced 2026-01-05 11:40:06 +00:00
feat: add a new config maxHeaderLineLength
This commit is contained in:
@@ -7,9 +7,19 @@ const name = 'maxLineLength'
|
||||
const description = 'Restrict lines to the specified length.'
|
||||
const message = 'Line exceeds maximum length'
|
||||
|
||||
const test = (value: string, lineNumber: number, config?: LintConfig) => {
|
||||
const test = (
|
||||
value: string,
|
||||
lineNumber: number,
|
||||
config?: LintConfig,
|
||||
isHeaderLine?: boolean
|
||||
) => {
|
||||
const severity = config?.severityLevel[name] || Severity.Warning
|
||||
const maxLineLength = config?.maxLineLength || 80
|
||||
let maxLineLength = config?.maxLineLength || 80
|
||||
|
||||
if (isHeaderLine && config) {
|
||||
maxLineLength = Math.max(config.maxLineLength, config.maxHeaderLineLength)
|
||||
}
|
||||
|
||||
if (value.length <= maxLineLength) return []
|
||||
return [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user