Skip to content

Commit

Permalink
Fix for nameShouldNotBeKeyword
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Dec 6, 2023
1 parent 0251143 commit 46df6fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ const valuesForNodeName = (node: { name: string}) => [node.name ?? '']

const sourceMapForNodeName = (node: Node & { name: string }) => {
if (!node.sourceMap) return undefined
console.info('offset', node.kind, node.name, getOffsetForName(node))
const nodeOffset = getOffsetForName(node)
return node.sourceMap && new SourceMap({
start: new SourceIndex({
Expand Down Expand Up @@ -124,9 +123,10 @@ export const nameShouldBeginWithUppercase = nameMatches(/^[A-Z]/)

export const nameShouldBeginWithLowercase = nameMatches(/^[a-z_<]/)

export const nameShouldNotBeKeyword = error<Entity | Parameter | Variable | Field | Method>(node =>
export const nameShouldNotBeKeyword = error<Parameter | Variable | Field | Method>(node =>
!RESERVED_WORDS.includes(node.name || ''),
node => [node.name || ''],
node => [node.name ?? ''],
sourceMapForNodeName,
)

export const inlineSingletonShouldBeAnonymous = error<Singleton>(
Expand Down

0 comments on commit 46df6fe

Please sign in to comment.