1
0
mirror of https://github.com/sasjs/lint.git synced 2025-12-10 17:34:36 +00:00

chore: add enum for lineEndings in sasjs-lint-schema.json

This commit is contained in:
2023-02-20 16:10:10 +05:00
parent 40e90995f8
commit bc7a7a7645
4 changed files with 5 additions and 3 deletions

View File

@@ -125,7 +125,7 @@ This will check each line to ensure that the count of leading spaces can be divi
### lineEndings
This setting ensures the line endings in a file conform to the configured type. Possible values are `lf` and `crlf`. If the value is missing, null or undefined then the check would be switched off (no default applied).
This setting ensures the line endings in a file to conform the configured type. Possible values are `lf`, `crlf` and `off` (off means rule is set to be off). If the value is missing, null or undefined then the check would be switched off (no default applied).
- Severity: WARNING

View File

@@ -182,6 +182,7 @@
"lineEndings": {
"$id": "#/properties/lineEndings",
"type": "string",
"enum": ["lf", "crlf", "off"],
"title": "lineEndings",
"description": "Enforces the configured terminating character for each line. Shows a warning when incorrect line endings are present.",
"default": "lf",

View File

@@ -1,4 +1,5 @@
export enum LineEndings {
LF = 'lf',
CRLF = 'crlf'
CRLF = 'crlf',
OFF = 'off'
}

View File

@@ -82,7 +82,7 @@ export class LintConfig {
}
}
if (json?.lineEndings) {
if (json?.lineEndings && json.lineEndings !== LineEndings.OFF) {
if (
json.lineEndings !== LineEndings.LF &&
json.lineEndings !== LineEndings.CRLF