Skip to content

Commit

Permalink
Merge branch 'release/v1.3.0-eslint'
Browse files Browse the repository at this point in the history
  • Loading branch information
trongthanh committed Jan 4, 2016
2 parents cc6fd7b + 53ced99 commit b5e9588
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 28 deletions.
60 changes: 60 additions & 0 deletions sublimetext/Packages/JavaScript/eslintrc.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<snippet>
<content><![CDATA[
// Nau standard eslint rules
{
"extends": "eslint:recommended",
"rules": {
"block-scoped-var" : 1,
"camelcase" : 2,
"comma-style" :[2, "last" ],
"comma-dangle" : 2,
"comma-spacing" :[2, { "before": false, "after": true} ],
"curly" :[2, "all" ],
"dot-notation" :[2, { "allowKeywords": true } ],
"eqeqeq" :[2, "allow-null" ],
"indent" :[2, "tab" ],
"linebreak-style" :[2, "unix" ],
// must: new ClassFunction(); but allow: Component() (JSX component)
"new-cap" :[2, { "capIsNew": false } ],
"no-bitwise" : 2,
"no-caller" : 2,
"no-console" : 0,
"no-eval" : 2,
"no-invalid-this" : 0,
"no-iterator" : 2,
"no-loop-func" : 2,
"no-multi-str" : 2,
"no-new" : 2,
"no-proto" : 2,
"no-script-url" : 2,
"no-sequences" : 2,
"no-shadow" : 2,
"no-with" : 2,
"one-var" :[2, "never"],
"quotes" :[2, "single" ],
"semi" :[2, "always" ],
"space-after-keywords" : 2,
"space-before-blocks" : 2,
"space-before-keywords" : 2,
"space-infix-ops" : 2,
"space-return-throw-case" : 2,
"space-unary-ops" :[2, { "words": true }],
"strict" : 0,
"valid-jsdoc" : 2
},
"globals": {
},
"env": {
"browser": true
},
"plugins": []
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>eslintrc</tabTrigger>
<description>.eslintrc</description>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
32 changes: 9 additions & 23 deletions sublimetext/Packages/JavaScript/jscsrc.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
<snippet>
<content><![CDATA[{
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowRightStickedOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"requireRightStickedOperators": ["!"],
"requireLeftStickedOperators": [","],
"disallowImplicitTypeConversion": ["string"],
"disallowKeywords": ["with"],
"disallowKeywordsOnNewLine": ["else"],
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"excludeFiles": ["test/data/**"],
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
"preset": "google",
"disallowMultipleVarDecl": false,
"validateIndentation": {
"value": "\t",
"allExcept": ["comments"]
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"validateJSDoc": {
"checkParamNames": true,
"requireParamTypes": true
},
"validateIndentation": "\t",
"validateQuoteMarks": "'"
"maximumLineLength": false,
"disallowSpacesInsideParentheses": false,
"disallowMultipleLineBreaks": false,
"disallowSpacesInsideObjectBrackets": false
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
Expand Down
28 changes: 24 additions & 4 deletions sublimetext/Packages/User/FuzzyFilePath.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
{
// set project_directory relative to sublime project directory
"project_directory": "",

// base directory for paths relative to project_directory. Used if scope-trigger contains "base_directory": true
// watch out for side effects with project directory (if base_directory is not within project_directory)
"base_directory": false,

// disable automatic path completions
"disable_autocompletions": false,

// disable keymaps
"disable_keymap_actions": false,

// ignore folders that match following regular expressions
"exclude_folders": ["node\\_modules", "bower\\_components/.*/bower\\_components"],

// logs scope evaluation to console to debug configuration
"log": false,

// LIST OF TRIGGERS FOR AUTO COMPLETION
// - setting "scopes" in user settings will override all other scopes.
// - triggers are evaluated in given order. First match wins
Expand All @@ -18,13 +37,14 @@
"prefix": ["require", "define"], // 2. trigger only if: require(<cursor>, define([<cursor>
// if 1 & 2 are true:
"auto": true, // auto suggest filepaths, else only by shorctut
"extensions": ["js", "jsx", "tmpl", "hbs", "json"], // js files, and others that can be imported as AMD
"extensions": ["js","jsx","json","hbs","tmpl"], // show only .js files
"relative": false, // insert absolute
"base_directory": true, // insert absolute from the set base directory (above)
"replace_on_insert": [
["^.*?/app", "app"], // remove the path before app, we commonly import from app/
["\\.js$", ""], // after insertion, remove .js from path
["\\/index$", ""], // nodejs will load index.js by default => also remove index
["\\.jsx$", ""] // remove .jsx for ReactJS module files
["(.*?)\\.jsx$", "jsx!\\1"], // after insertion, remove .jsx from path and add jsx! prefix
["([^.])\\/index$", "\\1"] // nodejs will load index.js by default => also remove index
]
},
{
Expand Down Expand Up @@ -101,6 +121,6 @@
"auto": false,
"extensions": ["js", "html", "css", "scss", "less", "png", "gif", "jpeg", "jpg", "svg"],
"relative": true
},
}
]
}
1 change: 1 addition & 0 deletions sublimetext/Packages/User/Package Control.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"SCSS",
"Select Quoted",
"SublimeLinter",
"SublimeLinter-contrib-eslint",
"SublimeLinter-contrib-scss-lint",
"SublimeLinter-csslint",
"SublimeLinter-jscs",
Expand Down
5 changes: 4 additions & 1 deletion sublimetext/Packages/User/Preferences.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"ensure_newline_at_eof_on_save": true,
// nice monospace font from Adobe, the light variant looks
// very pleasing on dark theme
// "font_face": "Source Code Pro Light",
Expand All @@ -13,7 +14,9 @@
".git",
".hg",
"CVS",
".sass-cache"
".sass-cache",
"node_modules",
".meteor/local"
],
//this must be set in user settings to be enabled in MAC OSX
"scroll_past_end": true,
Expand Down
84 changes: 84 additions & 0 deletions sublimetext/Packages/User/SublimeLinter.sublime-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"csslint": {
"@disable": true,
"args": [],
"errors": "",
"excludes": [],
"ignore": "",
"warnings": ""
},
"eslint": {
"@disable": false,
"args": [
"--stdin-filename",
"@"
],
"excludes": []
},
"jscs": {
"@disable": true,
"args": [],
"excludes": []
},
"jshint": {
"@disable": true,
"args": [],
"excludes": []
},
"json": {
"@disable": false,
"args": [],
"excludes": [],
"strict": true
},
"jsxhint": {
"@disable": false,
"args": [],
"excludes": []
},
"scss": {
"@disable": false,
"args": [],
"exclude-linter": "",
"excludes": [],
"include-linter": ""
}
},
"mark_style": "squiggly underline",
"no_column_highlights_line": false,
"passive_warnings": false,
"paths": {
"linux": [],
"osx": [],
"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",
"php": "html",
"python django": "python",
"typescript": "javascript"
},
"warning_color": "DDB700",
"wrap_find": true
}
}
1 change: 1 addition & 0 deletions sublimetext/Packages/User/editorconfig.sublime-snippet
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
Expand Down

0 comments on commit b5e9588

Please sign in to comment.