mirror of
https://github.com/sasjs/lint.git
synced 2026-04-10 07:53:15 +00:00
feat: new rule added 'strictMacroDefinition'
This commit is contained in:
@@ -3,7 +3,7 @@ import { LintConfig } from '../types/LintConfig'
|
||||
import { getLintConfig } from './getLintConfig'
|
||||
|
||||
const expectedFileLintRulesCount = 4
|
||||
const expectedLineLintRulesCount = 5
|
||||
const expectedLineLintRulesCount = 6
|
||||
const expectedPathLintRulesCount = 2
|
||||
|
||||
describe('getLintConfig', () => {
|
||||
|
||||
@@ -17,7 +17,8 @@ export const DefaultLintConfiguration = {
|
||||
indentationMultiple: 2,
|
||||
hasMacroNameInMend: true,
|
||||
noNestedMacros: true,
|
||||
hasMacroParentheses: true
|
||||
hasMacroParentheses: true,
|
||||
strictMacroDefinition: true
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,11 +6,14 @@ export const trimComments = (
|
||||
|
||||
if (commentStarted || trimmed.startsWith('/*')) {
|
||||
const parts = trimmed.split('*/')
|
||||
if (parts.length > 1) {
|
||||
if (parts.length === 2) {
|
||||
return {
|
||||
statement: (parts.pop() as string).trim(),
|
||||
commentStarted: false
|
||||
}
|
||||
} else if (parts.length > 2) {
|
||||
parts.shift()
|
||||
return trimComments(parts.join('*/'), false)
|
||||
} else {
|
||||
return { statement: '', commentStarted: true }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user