【问题标题】:Modify coffeelint rule on code by comment通过注释修改代码的 coffeelint 规则
【发布时间】:2014-05-07 15:13:01
【问题描述】:

是否可以添加一些注释以忽略或修改某个块上的咖啡规则(缩进)?

我在脚本上使用最多 80 列的规则,但我有一些超过该值的 objetc 字符串值,并且断行会使代码更难阅读。

例如:

##
# @coffeelint ignore max_line_length
##
object:
  attr: "some/huge/line/string/with/embed/#{values}.that/surpasses/the/max/column/width"

【问题讨论】:

    标签: coffeescript lint coffeelint


    【解决方案1】:

    这是它的语法。

     # coffeelint: disable=max_line_length
     object:
       attr: "some/huge/line/string/with/embed/#{values}.that/surpasses/the/max/column/width"
     # coffeelint: enable=max_line_length
    

    【讨论】:

    • 谢谢!也帮助了我
    猜你喜欢
    • 2015-05-17
    • 2019-07-03
    • 1970-01-01
    • 2014-12-15
    • 1970-01-01
    • 2011-03-08
    • 1970-01-01
    • 1970-01-01
    • 2018-12-07
    相关资源
    最近更新 更多