npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-jscheck

v1.0.4

Published

gulp plugin for jscheck in frontend project

Downloads

2

Readme

js代码检查gulp插件

js代码风格检查使用的统一jshint与jscs规范

使用方法:

    var jscheck = require('gulp-jscheck');
    gulp.src('xxx.js').pipe(jscheck({
        reporter: true,
        abort: true
    }));

配置参数:

  • reporter[boolean]: 是否使用reporter,默认为false。 如果开启,则会在项目根目录下创建jshint.log与jscs.log来记录代码检查的错误日志,方便进行改正
  • abort[boolean]: 是否当检查到jshint或jscs错误时就抛出异常并终止构建,默认为false。 如果开启,则当打包过程中出现jshint或jscs错误时就会给出提示并强制终止构建,目的在强制要求修正这些问题

模块中内置的jshint与jscs配置项

  • jshint
{
    "indent"        : 4,
    "quotmark"      : "single",
    "bitwise"       : true,
    "camelcase"     : true,
    "curly"         : true,
    "eqeqeq"        : true,
    "es3"           : true,
    "forin"         : true,
    "freeze"        : true,
    "immed"         : true,
    "latedef"       : true,
    "newcap"        : true,
    "noarg"         : true,
    "noempty"       : true,
    "nonbsp"        : true,
    "nonew"         : true,
    "plusplus"      : true,
    "undef"         : true,
    "unused"        : true,
    "strict"        : true,
    "trailing"      : true,
    "asi"           : false,
    "boss"          : false,
    "debug"         : false,
    "eqnull"        : false,
    "esnext"        : true,
    "evil"          : false,
    "expr"          : false,
    "funcscope"     : false,
    "globalstrict"  : false,
    "iterator"      : false,
    "lastsemic"     : false,
    "laxbreak"      : false,
    "laxcomma"      : false,
    "loopfunc"      : false,
    "moz"           : false,
    "multistr"      : false,
    "notypeof"      : false,
    "proto"         : false,
    "scripturl"     : false,
    "smarttabs"     : false,
    "shadow"        : false,
    "sub"           : false,
    "supernew"      : false,
    "validthis"     : false,
    "noyield"       : false,
    "browser"       : true,
    "jquery"        : true,
    "node"          : true,
    "phantom"       : true,
    "nomen"         : false,
    "onevar"        : false,
    "passfail"      : false,
    "white"         : false,
    "maxparams"     : 5,
    "maxdepth"      : 6,
    "maxstatements" : 30,
    "maxcomplexity" : 20,
    "maxlen"        : 100,
    "predef": [
        "console"    ,
        "KISSY"      ,
        "JSTracker"  ,
        "define"     ,
        "require"    ,
        "module"     ,
        "exports"    ,
        "describe"   ,
        "xdescribe"  ,
        "it"         ,
        "xit"        ,
        "before"     ,
        "after"      ,
        "beforeEach" ,
        "afterEach"  ,
        "alert"      ,
        "prompt"     ,
        "QN"         ,
        "JSON"
    ]
}
  • jscs:
{
    "preset": "google",
    "validateIndentation": 4,
    "disallowMultipleVarDecl": null,
    "disallowMultipleLineBreaks": null,
    "maximumLineLength": 100,
    "verbose": true
}