【问题标题】:JSHint: Function conventionsJSHint:函数约定
【发布时间】:2014-11-06 06:28:23
【问题描述】:

当我不遵循 Crockford 的函数约定时,我希望我的 JSHint 对我大喊大叫 - 即:

"函数名称与其参数列表的((左括号)之间不应有空格。)(右括号)和{(左括号)之间应有一个空格花括号) 开始语句体"

是否有启用此功能的选项?我以为"white":true 会起作用,但似乎不起作用。我知道 JSLint 也会抱怨这一点。

我的.jshintrc

{ "white": true, "node": true, "browser": true, "esnext": true, "bitwise": true, "camelcase": true, "curly": true, "eqeqeq": true, "immed": true, "indent": 2, "latedef": true, "newcap": true, "noarg": true, "quotmark": "single", "regexp": true, "undef": true, "nomen": false, "unused": true, "strict": true, "trailing": true, "smarttabs": true, "sub": true, "globals": { "angular": false, "d3": false } }

【问题讨论】:

    标签: javascript node.js naming-conventions jslint jshint


    【解决方案1】:

    我认为这可能是使用jscs 做的最好的事情。事实上有 presets for Crockford 可用。

    随着 JSHint 升级到版本 3,它将不再专注于作为样式工具。 (阅读JSHint 3 Plans)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-23
      • 1970-01-01
      • 2015-11-14
      • 1970-01-01
      • 1970-01-01
      • 2013-10-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多