Skip to content

Commit

Permalink
Merge pull request #154 from zhlint-project/jinjiang/fix/esm
Browse files Browse the repository at this point in the history
fix: rule: case-pure-western bug
  • Loading branch information
Jinjiang authored Mar 6, 2024
2 parents 88e300b + 82c33a7 commit fb1d4ac
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 46 deletions.
76 changes: 37 additions & 39 deletions docs/zhlint.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/zhlint.es.js.map

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions src/rules/case-pure-western.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,19 @@ const findNonWestern = (group: MutableGroupToken): boolean => {
}

const resetValidation = (group: MutableGroupToken): void => {
group.modifiedSpaceAfter = group.spaceAfter
group.modifiedInnerSpaceBefore = group.innerSpaceBefore
group.modifiedStartValue = group.startValue
group.modifiedEndValue = group.endValue
group.validations.length = 0
group.forEach((token) => {
for (const target in ValidationTarget) {
removeValidationOnTarget(token, target as ValidationTarget)
}
token.validations.length = 0
token.modifiedSpaceAfter = token.spaceAfter
token.modifiedType = token.type
token.modifiedValue = token.value
if (token.type === GroupTokenType.GROUP) {
token.modifiedInnerSpaceBefore = token.innerSpaceBefore
resetValidation(token)
} else {
token.modifiedType = token.type
token.modifiedValue = token.value
}
})
}
Expand Down

0 comments on commit fb1d4ac

Please sign in to comment.