2016-12-28 19 views
2

嗨我使用崇高3建立在打字稿语言中的node.js服务器。编辑总是给我两个毫无意义的错误。一个是它要求我使用双引号而不是单引号。另一个是它只允许双倍空间作为缩进。崇高的文本3 Typescript选项卡缩进和单引号不允许

这里是它是如何看起来像: issue screen shot

这里是我的SublimeLinter用户设置:

{ 
"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": { 
     "jshint": { 
      "@disable": false, 
      "args": [], 
      "excludes": [] 
     }, 
     "tslint": { 
      "@disable": false, 
      "args": [], 
      "excludes": [], 
      "indent": 4 
     } 
    }, 
    "mark_style": "outline", 
    "no_column_highlights_line": true, 
    "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", 
     "magicpython": "python", 
     "php": "html", 
     "python django": "python", 
     "pythonimproved": "python" 
    }, 
    "warning_color": "DDB700", 
    "wrap_find": true 
} 

}

的问题实际上并不影响该项目,但错误的迹象惹恼我很多。有没有人有任何想法来解决它?

回答

2

您需要告知SublimeLinter-contrib-tslint不报告这些警告。将tslint.json文件添加到您的计算机,然后将SublimeLinter.sublime-settings文件更改为如下所示的最简单方法。

tslint.json

{ 
    "rules": { 
     "indent": false, 
     "quotemark": false, 
    } 
} 

SublimeLinter.sublime设定

{ 
"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": { 
     "jshint": { 
      "@disable": false, 
      "args": [], 
      "excludes": [] 
     }, 
     "tslint": { 
      "@disable": false, 
      "args": [], 
      "excludes": [], 
      "indent": 4, 
      "config_filename": "tsconfig.json" 
     } 
    }, 
    "mark_style": "outline", 
    "no_column_highlights_line": true, 
    "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", 
     "magicpython": "python", 
     "php": "html", 
     "python django": "python", 
     "pythonimproved": "python" 
    }, 
    "warning_color": "DDB700", 
    "wrap_find": true 
} 

注:增加"config_filename": "tsconfig.json"键值应该指向您的配置文件

的绝对路径

您也可以删除SublimeLinter-contrib-tslint包。

有关该软件包的更多信息,还可以查看存储库自述文件。 https://github.com/lavrton/SublimeLinter-contrib-tslint