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

feat: new rule added 'strictMacroDefinition'

This commit is contained in:
Saad Jutt
2021-05-20 19:14:01 +05:00
parent e5780cd69a
commit dcfeb7a641
7 changed files with 190 additions and 4 deletions

View File

@@ -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 }
}