sublimelinter-jshinter

---

ocalhost:~ nihao$ sudo npm install jshint -g
Password:
/usr/local/bin/jshint -> /usr/local/lib/node_modules/jshint/bin/jshint
[email protected] /usr/local/lib/node_modules/jshint
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
localhost:~ nihao$

-

设置配置文件:

SublineText》Preferences》Package Settings》Package Control》Settings-User》
=================================================

{
    "installed_packages":
    [
        "HTML-CSS-JS Prettify",
        "Node Completions",
        "SublimeLinter-jshint"
    ],

    "sublimelinter": "save-only",
    "sublimelinter_popup_errors_on_save": true,
    "sublimelinter_executable_map": {
        "javascript": "/usr/local/bin/node",
        "css": "/usr/local/bin/node"//"D:/nodejs/node.exe"
    },
    "jshint_options": {
        "strict": false,
        "quotmark": "single", //只能使用单引号
        "noarg": true,
        "noempty": true, //不允许使用空语句块{}
        "eqeqeq": true, //!==和===检查
        "undef": true,
        "curly": true, //值为true时,不能省略循环和条件语句后的大括号
        "forin": true, //for in hasOwnPropery检查
        "devel": true,
        "jquery": true,
        "browser": true,
        "wsh": true,
        "evil": true,
        //"unused": "vars", //形参和变量未使用检查
        "latedef": true, //先定义变量,后使用
        "globals": {
            "grunt": true,
            "module": true,
            "window": true,
            "jQuery": true,
            "$": true,
            "global": true,
            "document": true,
            "console": true,
            "setTimeout": true,
            "setInterval": true
        }
    },
    "csslint_options": {
        "adjoining-classes": false,
        "box-sizing": false,
        "box-model": false,
        "compatible-vendor-prefixes": false,
        "floats": false,
        "font-sizes": false,
        "gradients": false,
        "important": false,
        "known-properties": false,
        "outline-none": false,
        "qualified-headings": false,
        "regex-selectors": false,
        "shorthand": false,
        "text-indent": false,
        "unique-headings": false,
        "universal-selector": false,
        "unqualified-attributes": false
    }

}

--

--MAC安装Sublime Linter - jshint 插件:
在mac sublime中按下:commond+shift+p
在弹出的输入框中输入:install package
然后在弹出的输入框中输入选择:sublimelinter 
然后继续安装:sublimelinter-jshint

在Node中安装:npm install jshint -g

--

Package Control Messages
========================

SublimeLinter:
-------------

____ _ _ _ _ _ _
/ ___| _ _| |__ | (_)_ __ ___ ___| | (_)_ __ | |_ ___ _ __
\___ \| | | | ‘_ \| | | ‘_ ` _ \ / _ \ | | | ‘_ \| __/ _ \ ‘__|
___) | |_| | |_) | | | | | | | | __/ |___| | | | | || __/ |
|____/ \__,_|_.__/|_|_|_| |_| |_|\___|_____|_|_| |_|\__\___|_|

Welcome to SublimeLinter, a linter framework for Sublime Text 3.

* * * IMPORTANT! * * *

SublimeLinter 3 is NOT a drop-in replacement for
earlier versions.

Linters *NOT* included with SublimeLinter 3,
they must be installed separately.

The settings are different.

* * * READ THE DOCS! * * *

Otherwise you will never know how to install linters, nor will
you know about all of the great new features in SublimeLinter 3.

For complete documentation on how to install and use SublimeLinter,
please see:

http://www.sublimelinter.com

_ _ _ _
| | | | ___| |_ __ | |
| |_| |/ _ \ | ‘_ \| |
| _ | __/ | |_) |_|
|_| |_|\___|_| .__/(_)
|_|

Hundreds of hours have been spent writing and documenting SublimeLinter
to make it the best it can be — easy to use, easy to configure,
easy to update, easy to extend. If you use SublimeLinter and feel
it is making your coding life better and easier, please consider
making a donation to help fund development and support.

To donate: https://github.com/SublimeLinter/SublimeLinter3#share-the-love

Thank you!

--

 

Package Control Messages
========================

SublimeLinter-jshint:
--------------------

SublimeLinter-jshint
-------------------------------
This linter plugin for SublimeLinter provides an interface to jshint.

** IMPORTANT! **

Before this plugin will activate, you *must*
follow the installation instructions here:

https://github.com/SublimeLinter/SublimeLinter-jshint

-

.jshintrc 文件放在工程的根目录下:

{
    "camelcase" : true,
    "indent": 2,
    "undef": true,
    "quotmark": single,
    "maxlen": 80,
    "trailing": true,
    "curly": true
}

----

参考资料
http://sublimelinter.readthedocs.org/en/latest/gutter_themes.html
https://github.com/SublimeLinter/SublimeLinter-jshint

JSHint Options

http://jshint.com/docs/options/
http://cweili.gitcafe.com/jshint-options/
http://corncandy.github.io/2014/05/31/jshint-options/

--

--------------------

时间: 2024-10-05 10:36:38

sublimelinter-jshinter的相关文章

sublime插件@sublimelinter安装使用

sublimelinter插件是一款sublime编辑器的代码校验插件,支持多种语言,对于前端来说主要包含css和js校验. 要是用这款插件 1)安装node,然后在全局安装jshint(npm install -g jshint)和csslint(npm install -g csslint) 2)在sublime中安装sublimelinter插件,然后在安装sublimelinter-jshintch插件和sublimelinter-csslint插件 3)然后在tool>sublimel

在SUBLIME TEXT中安装SUBLIMELINTER进行JS&CSS代码校验

一:Sublime Text 中需要先安装Package Control.(如果有则无需安装) 安装方法:打开Sublime Text控制台(快捷键Ctrl+`),在控制台粘贴以下代码,按回车执行. 1 import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package

求教Sublime Text2 SublimeLinter插件安装问题

昨天装了 SublimeLinter插件(代码语法检测),这个事插件的地址:https://github.com/Kronuz/SublimeLinter 按照作者的介绍配置了一下,发现语法检测不起作用,快捷键也没效果.个人英文不好,求大侠指导,多谢了. 下面是我的配置文件设置,我的PHP路径是d:\php\php\php.exe 在settings-User里头加上这个: { "sublimelinter_executable_map":{"php":"

借助 SublimeLinter 编写高质量的 JavaScript & CSS 代码

SublimeLinter 是前端编码利器——Sublime Text 的一款插件,用于高亮提示用户编写的代码中存在的不规范和错误的写法,支持 JavaScript.CSS.HTML.Java.PHP.Python.Ruby 等十多种开发语言.这篇文章介绍如何在 Windows 中配置 SublimeLinter 进行 JS & CSS 校验. 准备工作 安装 Sublime Text 包管理工具:http://wbond.net/sublime_packages/package_control

sublime中安装sublimelinter php 语法检查

打开控制台,install package 搜 sublimelinter 先安装sublimelinter本体 安装完以后再搜索一下,安装sublimelinter-php 接下来,打开preferences-package settings-sublimeLinter-settings--user 如下配置: 1 { 2 "user": { 3 4 "linters": { 5 6 }, 7 8 "paths": { 9 "linu

Sublime text3 016 SublimeLinter(PHP 代码检测)

Sublime text3 016 SublimeLinter(PHP 代码检测)------------------------------------------------------------------------------如果有什么不明白的,加QQ群:186970878 经常会有错字 或 语句不通的,欢迎联系本人,方便快速修正,也方便后来者阅读. 联系本人QQ: 2071551682-------------------------------------------------

Sublime3插件安装

首先声明一下,小编是做后台开发出身,但是总是想捣鼓一些小的网站出来,可能是完美心作祟,感觉前端这边不能差事,所以就自己上了,一开始是用eclipse来开发的,具体原因忘了,也不知道怎么就开始用Sublime了,猜测应该是老师推荐的. 由于本人有强烈的系统癖,经常会把盘格掉,然后重做系统,这样导致的直接后果就是,不断的安装各种日常软件,当然包括Sublime了,众所周知,Sublime主要是通过集成各式各样的插件,来实现高效编程的. 而最让小编头疼就是插件的安装,因为并不是特别了解各种插件的功能以

sublime text插件

使用Package Control组件安装 也可以安装package control组件,然后直接在线安装: 按Ctrl+`调出console(注:安装有QQ输入法的这个快捷键会有冲突的,输入法属性设置-输入法管理-取消热键切换至QQ拼音) 粘贴以下代码到底部命令行并回车: 1 import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); url

10个优化代码的CSS和JavaScript工具

  检查和测试代码来发现任何潜在错误,从而在放到网站上之前及时消除错误是一个非常重要的过程.代码检查的过程也俗称为是Web设计师和开发者之间的linting.作为一个设计师,如果你想要写出高度优化的代码,那么你一定需要linting工具.有两种类型的代码检查工具.一种是在执行时间检查代码中的错误和bug.另一种是使用静态代码分析技术并在执行前检查码.后者因为可以节省时间和麻烦显然更佳. 事实上,linting可以放在不同的阶段.如果你喜欢在敲代码的时候测试代码,那么你可以使用lint工具.当然,

2015-2016前端知识体系

一.框架与组件 ?bootstrap等UI框架设计与实现 伸缩布局:grid网格布局 基础UI样式:元素reset.按钮.图片.菜单.表单 组件UI样式:按钮组.字体图标.下拉菜单.输入框组.导航组.面包屑.分页.标签.轮播.弹出框.列表.多媒体.警告 响应式布局:布局.结构.样式.媒体.javascript响应式 第三方插件:插件管理 ?jQuery.zepto使用原理以及插件开发 支持amd.cmd.全局变量的模块化封装 $.fn.method = function(){} ?mvc/mvv