diff --git a/README.md b/README.md index 8cf805c..5888a1c 100644 --- a/README.md +++ b/README.md @@ -124,9 +124,8 @@ 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`. +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). -- Default: lf - Severity: WARNING ### lowerCaseFileNames diff --git a/src/types/LintConfig.spec.ts b/src/types/LintConfig.spec.ts index 5586f22..c7abef8 100644 --- a/src/types/LintConfig.spec.ts +++ b/src/types/LintConfig.spec.ts @@ -168,7 +168,8 @@ describe('LintConfig', () => { hasMacroNameInMend: true, noNestedMacros: true, hasMacroParentheses: true, - noGremlins: true + noGremlins: true, + lineEndings: 'lf' }) expect(config).toBeTruthy() diff --git a/src/types/LintConfig.ts b/src/types/LintConfig.ts index 9a0800e..c4fff84 100644 --- a/src/types/LintConfig.ts +++ b/src/types/LintConfig.ts @@ -82,7 +82,6 @@ export class LintConfig { } } - this.fileLintRules.push(lineEndings) if (json?.lineEndings) { if ( json.lineEndings !== LineEndings.LF && @@ -92,6 +91,7 @@ export class LintConfig { `Invalid value for lineEndings: can be ${LineEndings.LF} or ${LineEndings.CRLF}` ) } + this.fileLintRules.push(lineEndings) this.lineEndings = json.lineEndings } diff --git a/src/utils/getLintConfig.spec.ts b/src/utils/getLintConfig.spec.ts index 7843ad8..82da01d 100644 --- a/src/utils/getLintConfig.spec.ts +++ b/src/utils/getLintConfig.spec.ts @@ -2,7 +2,7 @@ import * as fileModule from '@sasjs/utils/file' import { LintConfig } from '../types/LintConfig' import { getLintConfig } from './getLintConfig' -const expectedFileLintRulesCount = 6 +const expectedFileLintRulesCount = 5 const expectedLineLintRulesCount = 6 const expectedPathLintRulesCount = 2