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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mt-lint

v0.0.21

Published

bfe mt-lint

Readme

安装

必要条件: Node.js (>=7.x), npm version 4+ and Git.

$ npm install -g mt-lint

使用

说明:iOS使用Xcode9开发时需在主工程设置里面把COMPILER_INDEX_STORE_ENABLE设置为NO,如果使用CocoaPods,需要在Podfile里面添加hook:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['COMPILER_INDEX_STORE_ENABLE'] = 'NO'
        end
    end
end

###1.手动

mt-lint支持手动执行命令来做代码静态检查,使用前只需执行mt-lint add -P ios/android/js 命令设置平台即可,然后执行mt-lint start [path]传入工程文件路径即可开始检查。

Example:

$ mt-lint add -P ios
$ mt-lint start my_projece_path

###2.自动

mt-lint支持在git的commit操作时自动调用start扫描命令,但需要打开pre-commit的开关:mt-lint add -H [path],前提是需要使用-P参数先设置平台,此时传入的path为.git目录所在路径。(如果为ios工程,需确保.git与项目工程文件在同一目录下,如果不在同一目录下,需要设置额外参数设置项目工程文件路径:mt-lint add -H [git-path] -S [proj-path],这两个选项要同时使用才能生效)

注意:如果遇到紧急情况需要强制提交而不经过扫描流程,可以在git commit时增加--no-verify/-n 来强制提交代码。

Example:

$ mt-lint add -P ios -H my_projece_path
$ git commit -am "commit"

详细使用

说明:除了以上简单使用中的命令,其他命令都不是必须的。

mt-lint add

$ mt-lint add --platform/-P ios/android/js  
说明:该命令用来确定你所要使用的平台, 默认iOS。
$ mt-lint add --rule/-R [path...] 
说明:该命令用来添加自定义规则目录,会把该目录设为mt-lint的分析规则加载路径, 如果不添加会有默认的规则,目前只支持iOS/JS。
$ mt-lint add --hook/-H [path...] 
说明:该命令会hook掉git的preCommit,执行该命令后在git commit命令的时候自定执行mt-lint代码静态扫描。
$ mt-lint add --source/-S [path...] 
说明:该命令需要与--hook命令配合使用,仅适用于ios平台,path需传入项目工程文件.xcworkspace/.xcodeproj所在的路径。

mt-lint remove

$ mt-lint remove --platform/-P ios/android/js  
说明:该命令用来移除以前添加平台。
$ mt-lint remove --hook/-H [path...] 
说明:该命令会关闭git preCommit的hook操作,回到正常的代码提交流程。

mt-lint analyze

$ mt-lint analyze --add/-a [path...]   
说明:添加待分析文件目录,只支持iOS。
$ mt-lint analyze --ignore/-i [path...] 
说明:忽略待分析的文件目录, 默认会忽略Pods文件夹,只支持iOS。

mt-lint report

$ mt-lint report [path...]  
说明:自定义分析结果报告的路径,只支持iOS。

mt-lint start

$ mt-lint start [path...]  
说明:开始分析。