期望 ')' 匹配 '(' 而不是看到 运行 JSHint

Expected ')' to match '(' from instead saw while running the JSHint

我正在使用 d3 库绘制 path/line,为此我需要使用 stroke-dasharray 属性,如下所示。

这对我来说很好,

vis.append("path")
   .attr("class", "predictedLowerCI")
   .attr("d", valueline5(scope.rowdata))
   .attr({ 'stroke-dasharray': (2, 2) })

当我 运行 JSHint 时,出现以下错误

"Expected ')' to match '(' from line 194 and instead saw ','."

我在哪里使用了 stroke-dasharray。错误是针对(2, 2)这种语法而来的,基本上JSHint似乎不​​喜欢d3的这种语法。有没有办法告诉 JSHint 这是一个有效的语法?

我相信它正在寻找一个字符串

vis.append('path')
   .attr('class', 'predictedLowerCI')
   .attr('d', valueline5(scope.rowdata))
   .attr({'stroke-dasharray': '2, 2'}) // change made here