[关闭]
@KingMe 2016-08-11T23:15:55.000000Z 字数 4582 阅读 1220

Windows 环境安装 sublime text3

windows sublime


1. 基础环境

2. 搭建Vue相关

  1. module.exports = {
  2. root: true,
  3. parser: 'babel-eslint',
  4. parserOptions: {
  5. sourceType: 'module'
  6. },
  7. // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
  8. extends: 'standard',
  9. // required to lint *.vue files
  10. plugins: [
  11. 'html'
  12. ],
  13. // add your custom rules here
  14. 'rules': {
  15. "indent": ["error", 4],
  16. // allow paren-less arrow functions
  17. 'arrow-parens': 0,
  18. // allow async-await
  19. 'generator-star-spacing': 0,
  20. // allow debugger during development
  21. 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
  22. "space-before-function-paren": [
  23. "error", {
  24. "anonymous": "ignore",
  25. "named": "ignore"
  26. }
  27. ]
  28. }
  29. }
  1. {
  2. // The plugin looks for a .jsbeautifyrc file in the same directory as the
  3. // source file you're prettifying (or any directory above if it doesn't exist,
  4. // or in your home folder if everything else fails) and uses those options
  5. // along the default ones.
  6. // Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options
  7. // Documentation: https://github.com/einars/js-beautify/
  8. "html": {
  9. "allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "vue"],
  10. "brace_style": "collapse", // [collapse|expand|end-expand|none] Put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are
  11. "end_with_newline": false, // End output with newline
  12. "indent_char": " ", // Indentation character
  13. "indent_handlebars": false, // e.g. {{#foo}}, {{/foo}}
  14. "indent_inner_html": false, // Indent <head> and <body> sections
  15. "indent_scripts": "keep", // [keep|separate|normal]
  16. "indent_size": 4, // Indentation size
  17. "max_preserve_newlines": 0, // Maximum number of line breaks to be preserved in one chunk (0 disables)
  18. "preserve_newlines": true, // Whether existing line breaks before elements should be preserved (only works before elements, not inside tags or for text)
  19. "unformatted": ["a", "span", "img", "code", "pre", "sub", "sup", "em", "strong", "b", "i", "u", "strike", "big", "small", "pre", "h1", "h2", "h3", "h4", "h5", "h6"], // List of tags that should not be reformatted
  20. "wrap_line_length": 0 // Lines should wrap at next opportunity after this number of characters (0 disables)
  21. },
  22. "css": {
  23. "allowed_file_extensions": ["css", "scss", "sass", "less"],
  24. "end_with_newline": false, // End output with newline
  25. "indent_char": " ", // Indentation character
  26. "indent_size": 4, // Indentation size
  27. "newline_between_rules": true, // Add a new line after every css rule
  28. "selector_separator": " ",
  29. "selector_separator_newline": true // Separate selectors with newline or not (e.g. "a,\nbr" or "a, br")
  30. },
  31. "js": {
  32. "allowed_file_extensions": ["js", "json", "jshintrc", "jsbeautifyrc"],
  33. // Set brace_style
  34. // collapse: (old default) Put braces on the same line as control statements
  35. // collapse-preserve-inline: (new default) Same as collapse but better support for ES6 destructuring and other features. https://github.com/victorporof/Sublime-HTMLPrettify/issues/231
  36. // expand: Put braces on own line (Allman / ANSI style)
  37. // end-expand: Put end braces on own line
  38. // none: Keep them where they are
  39. "brace_style": "collapse-preserve-inline",
  40. "break_chained_methods": false, // Break chained method calls across subsequent lines
  41. "e4x": false, // Pass E4X xml literals through untouched
  42. "end_with_newline": false, // End output with newline
  43. "indent_char": " ", // Indentation character
  44. "indent_level": 0, // Initial indentation level
  45. "indent_size": 4, // Indentation size
  46. "indent_with_tabs": false, // Indent with tabs, overrides `indent_size` and `indent_char`
  47. "jslint_happy": false, // If true, then jslint-stricter mode is enforced
  48. "keep_array_indentation": false, // Preserve array indentation
  49. "keep_function_indentation": false, // Preserve function indentation
  50. "max_preserve_newlines": 0, // Maximum number of line breaks to be preserved in one chunk (0 disables)
  51. "preserve_newlines": true, // Whether existing line breaks should be preserved
  52. "space_after_anon_function": false, // Should the space before an anonymous function's parens be added, "function()" vs "function ()"
  53. "space_before_conditional": true, // Should the space before conditional statement be added, "if(true)" vs "if (true)"
  54. "space_in_empty_paren": false, // Add padding spaces within empty paren, "f()" vs "f( )"
  55. "space_in_paren": false, // Add padding spaces within paren, ie. f( a, b )
  56. "unescape_strings": false, // Should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65"
  57. "wrap_line_length": 0 // Lines should wrap at next opportunity after this number of characters (0 disables)
  58. }
  59. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注