从bash shell为grunt安装phplint的命令是什么


What is the command to install phplint for grunt from the bash shell?

我习惯于使用类似的东西

npm install grunt-contrib-jshint --save-dev

用于安装。

然而,这并没有奏效:

npm install grunt-contrib-phplint --save-dev

我在这里找到了这些网站:

https://www.npmjs.com/package/phplint

https://github.com/jgable/grunt-phplint

但它看起来与我的其余代码不匹配。当然,我需要安装它并修改Gruntfile.js。

// you must load each module
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
// grunt.loadNpmTasks("grunt-phplint"); // from links

奇怪的是,这个特定的包没有使用contrib前缀。

简单用于安装:

npm install grunt-phplint --save-dev;

并以此加载任务:

grunt.loadNpmTasks("grunt-phplint");

最后这个来运行任务:

phplint: {
    good: [your_php_dir + "*.php"]
},