Skip to content

Commit f5f71db

Browse files
committed
v2 / Minor: fix linting issues.
1 parent 1927d82 commit f5f71db

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

lib-new/Transaction.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ module.exports = class Transaction
2121
# Convenience helper for nice getter syntax:
2222
# (NOTE: This does *not* support sibling setters, as we don't need it,
2323
# but it's possible to add support.)
24+
#
25+
# NOTE: CoffeeLint thinks this fat arrow is unnecessary here, but it's not:
26+
# https://github.com/clutchski/coffeelint/issues/555
27+
# coffeelint: disable=no_private_function_fat_arrows
28+
#
2429
get = (props) =>
2530
for name, getter of props
2631
Object.defineProperty @::, name,

test-new/transactions._coffee

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ describe 'Transactions', ->
128128

129129
{labels, properties} = fixtures.createTestNode module, _
130130

131+
# Add a random property so it's easier to look for it below:
132+
properties.test = "should isolate effects #{helpers.getRandomStr()}"
133+
131134
[{node}] = tx.cypher
132135
query: """
133136
CREATE (node:#{TEST_LABEL} {properties})
@@ -145,22 +148,12 @@ describe 'Transactions', ->
145148
results = DB.cypher
146149
query: """
147150
MATCH (node:#{TEST_LABEL})
148-
WHERE #{(
149-
# NOTE: Cypher doesn’t support directly comparing nodes and
150-
# property bags, so we have to compare each property.
151-
# HACK: CoffeeLint thinks the below is bad indentation.
152-
# https://github.com/clutchski/coffeelint/issues/456
153-
# coffeelint: disable=indentation
154-
for prop of properties
155-
"node.#{prop} = {properties}.#{prop}"
156-
# coffeelint: enable=indentation
157-
# HACK: CoffeeLint also thinks the below is double quotes!
158-
# https://github.com/clutchski/coffeelint/issues/368
159-
# coffeelint: disable=no_unnecessary_double_quotes
160-
).join ' AND '}
151+
// NOTE: Cypher doesn't support comparing a node or relationship
152+
// to an entire map of properties, so we check just the one
153+
// random one we created above:
154+
WHERE node.test = {properties}.test
161155
RETURN node
162156
"""
163-
# coffeelint: enable=no_unnecessary_double_quotes
164157
params: {properties}
165158
, _
166159

0 commit comments

Comments
 (0)