V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lijinma
V2EX  ›  Node.js

使用 jshint 的同学,可否晒一下你的配置文件?

  •  
  •   lijinma · 2014-04-26 18:39:54 +08:00 · 6256 次点击
    这是一个创建于 3624 天前的主题,其中的信息可能已经有所发展或是发生改变。
    最近使用jshint,想看看大家的配置文件。

    多谢。
    5 条回复    1970-01-01 08:00:00 +08:00
    jsonline
        1
    jsonline  
       2014-04-26 18:45:44 +08:00
    {
    "-W070": true,
    "asi": true,
    "bitwise": false,
    "browser": true,
    "camelcase": true,
    "curly": true,
    "eqeqeq": true,
    "es3": true,
    "esnext": true,
    "expr": true,
    "forin": false,
    "immed": true,
    "jquery": true,
    "latedef": true,
    "laxcomma": true,
    "newcap": false,
    "noarg": true,
    "node": true,
    "noempty": true,
    "plusplus": true,
    "smarttabs": true,
    "strict": true,
    "sub": true,
    "trailing": true,
    "undef": true,
    "unused": "var",
    "globals": {
    "define": true,
    "requirejs": true,
    "require": true
    }
    }
    jsonline
        2
    jsonline  
       2014-04-26 18:46:18 +08:00
    不同项目,配置不同
    lijinma
        3
    lijinma  
    OP
       2014-04-26 18:48:36 +08:00
    @jsonline 恩,了解,不过我还是想参考下别人的,学习下;

    多谢
    chemzqm
        4
    chemzqm  
       2014-04-27 04:46:58 +08:00

    {
    "sub":true,
    "regexp":true,
    "asi": true,
    "browser": true,
    "loopfunc":true,
    "expr":true,
    "node": true,
    "es5": true,
    "esnext": true,
    "bitwise": true,
    "curly": true,
    "latedef": false,
    "expr": true,
    "eqeqeq": false,
    "eqnull": false,
    "newcap": true,
    "noarg": true,
    "undef": true,
    "proto": true,
    "strict": false,
    "-W124": false, // A generator function shall contain a yield statement
    "-W014": false, // Bad line breaking before ? (in tertiary operator)
    "-W065": false, // Missing radix parameter to parseInt (defaults to 10)
    "-W069": false, // Literal accessor is better written in dot notation
    "globals": {
    "describe": true,
    "it": true,
    "beforeEach": true,
    "afterEach": true
    }
    }
    这个配置跟个人习惯关系很大,我还改了一些jshint源码,因为有些不想看到的错误没有提供选项。
    另外最好及时更新jshint项目获得更好的es6支持,如果需要的话
    lijinma
        5
    lijinma  
    OP
       2014-04-28 09:42:46 +08:00
    @chemzqm 非常感谢。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5740 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 01:52 · PVG 09:52 · LAX 18:52 · JFK 21:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.