文件: .eslintrc.json
內(nèi)容:
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"parserOptions": {
"sourceType": "module"
},
"rules": {
"no-cond-assign": [2, "always"], //if, while等條件中不允許使用“=”
"no-constant-condition": 2,
"no-debugger": 2, // 程序中不能出現(xiàn)debugger
"no-dupe-args": 2, // 函數(shù)的參數(shù)名稱不能重復(fù)
"no-dupe-keys": 2, // 對象的屬性名稱不能重復(fù)
"no-duplicate-case": 2, // switch的case不能重復(fù)
"no-func-assign": 2,
"no-obj-calls": 2,
"no-regex-spaces": 2,
"no-sparse-arrays": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"use-isnan": 2,
"valid-typeof": 2,
"eqeqeq": [2, "always"],
"no-caller": 2,
"no-eval": 2,
"no-redeclare": 2,
"no-undef": 2,
"no-unused-vars": 1,
"no-use-before-define": 2,
"comma-dangle": [1, "never"],
"no-const-assign": 2,
"no-dupe-class-members": 2
}
}
Preferences->Package Settings->SublimeLinter->Settings - User
{
"user": {
"debug": true, # 開啟 debug 選項(xiàng)
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"eslint": {
"@disable": false,
"args": [],
"excludes": []
},
"jshint": {
"@disable": false,
"args": [],
"excludes": []
},
"php": {
"@disable": false,
"args": [],
"excludes": []
}
},
"mark_style": "outline",
"no_column_highlights_line": false,
"passive_warnings": false,
"paths": {
"linux": [],
"osx": [
"/Users/wang/.nvm/versions/node/v5.0.0/bin" # 設(shè)置 node 路徑
],
"windows": []
},
"python_paths": {
"linux": [],
"osx": [],
"windows": []
},
"rc_search_limit": 3,
"shell_timeout": 10,
"show_errors_on_save": false,
"show_marks_in_minimap": true,
"syntax_map": {
"html (django)": "html",
"html (rails)": "html",
"html 5": "html",
"javascript (babel)": "javascript",
"magicpython": "python",
"php": "html",
"python django": "python",
"pythonimproved": "python"
},
"warning_color": "DDB700",
"wrap_find": true
}
}