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

chore(*): organise rules into folders by type

This commit is contained in:
Krishna Acondy
2021-04-07 16:34:33 +01:00
parent cc33ebb6e6
commit c9b6c3af95
26 changed files with 80 additions and 66 deletions

View File

@@ -0,0 +1,30 @@
import { LineLintRule } from '../../types/LintRule'
import { LintRuleType } from '../../types/LintRuleType'
import { Severity } from '../../types/Severity'
const name = 'noTrailingSpaces'
const description = 'Disallow trailing spaces on lines.'
const message = 'Line contains trailing spaces'
const test = (value: string, lineNumber: number) =>
value.trimEnd() === value
? []
: [
{
message,
lineNumber,
startColumnNumber: value.trimEnd().length + 1,
endColumnNumber: value.length,
severity: Severity.Warning
}
]
/**
* Lint rule that checks for the presence of trailing space(s) in a given line of text.
*/
export const noTrailingSpaces: LineLintRule = {
type: LintRuleType.Line,
name,
description,
message,
test
}