mirror of
https://github.com/sasjs/lint.git
synced 2026-01-08 21:10:05 +00:00
Revert "feat(*): add line endings rule, add automatic formatting for fixable violations"
This reverts commit 33a57c3163.
This commit is contained in:
@@ -2,8 +2,7 @@ import {
|
||||
hasDoxygenHeader,
|
||||
hasMacroNameInMend,
|
||||
noNestedMacros,
|
||||
hasMacroParentheses,
|
||||
lineEndings
|
||||
hasMacroParentheses
|
||||
} from '../rules/file'
|
||||
import {
|
||||
indentationMultiple,
|
||||
@@ -13,7 +12,6 @@ import {
|
||||
noTrailingSpaces
|
||||
} from '../rules/line'
|
||||
import { lowerCaseFileNames, noSpacesInFileNames } from '../rules/path'
|
||||
import { LineEndings } from './LineEndings'
|
||||
import { FileLintRule, LineLintRule, PathLintRule } from './LintRule'
|
||||
|
||||
/**
|
||||
@@ -29,7 +27,6 @@ export class LintConfig {
|
||||
readonly pathLintRules: PathLintRule[] = []
|
||||
readonly maxLineLength: number = 80
|
||||
readonly indentationMultiple: number = 2
|
||||
readonly lineEndings: LineEndings = LineEndings.LF
|
||||
|
||||
constructor(json?: any) {
|
||||
if (json?.noTrailingSpaces) {
|
||||
@@ -49,19 +46,6 @@ export class LintConfig {
|
||||
this.lineLintRules.push(maxLineLength)
|
||||
}
|
||||
|
||||
if (json?.lineEndings) {
|
||||
if (
|
||||
json.lineEndings !== LineEndings.LF &&
|
||||
json.lineEndings !== LineEndings.CRLF
|
||||
) {
|
||||
throw new Error(
|
||||
`Invalid value for lineEndings: can be ${LineEndings.LF} or ${LineEndings.CRLF}`
|
||||
)
|
||||
}
|
||||
this.lineEndings = json.lineEndings
|
||||
this.fileLintRules.push(lineEndings)
|
||||
}
|
||||
|
||||
if (!isNaN(json?.indentationMultiple)) {
|
||||
this.indentationMultiple = json.indentationMultiple as number
|
||||
this.lineLintRules.push(indentationMultiple)
|
||||
|
||||
Reference in New Issue
Block a user