V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
lijinma
V2EX  ›  Node.js

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

  •  
  •   lijinma · Apr 26, 2014 · 6944 views
    This topic created in 4392 days ago, the information mentioned may be changed or developed.
    最近使用jshint,想看看大家的配置文件。

    多谢。
    5 replies    1970-01-01 08:00:00 +08:00
    jsonline
        1
    jsonline  
       Apr 26, 2014
    {
    "-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  
       Apr 26, 2014
    不同项目,配置不同
    lijinma
        3
    lijinma  
    OP
       Apr 26, 2014
    @jsonline 恩,了解,不过我还是想参考下别人的,学习下;

    多谢
    chemzqm
        4
    chemzqm  
       Apr 27, 2014

    {
    "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
       Apr 28, 2014
    @chemzqm 非常感谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1259 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 102ms · UTC 16:50 · PVG 00:50 · LAX 09:50 · JFK 12:50
    ♥ Do have faith in what you're doing.