vue开发团队在sublime上的插件开发 仅有 Vue Syntax Highlight
语法高亮 一项,而未像 vscode
上的 vetur
插件那般 Syntax-highlighting Snippet Emmet Linting / Error Checking Formatting Auto Completion Debugging
等诸多功能,各项功能均需自己配置
* 语法高亮
Vue Syntax Highlight
🔗️ 278k- 如果
script
标签标记为type="text/ecmascript-6"
或type="text/babel"
,在新版的Vue Syntax Highlight
则无法对 js 代码进行高亮 - 旧版的
type="text/ecmascript-6"
解决方法是向vue.tmLanguage
文件当中添加|ecmascript
选项 🔗️
- 如果
Babel
🔗️ 500k
* 校验 参考链接 🔗️
1) sublime 插件 SublimeLinter-eslint
🔗️ 153k
This linter plugin for SublimeLinter provides an interface to ESLint
- npm 包
eslint
🔗️ - npm 包
eslint-plugin-vue
🔗️1
2plugins: ['vue'],
extends: ['plugin:vue/essential', 'eslint:recommended'],
2) sublime 插件 SublimeLinter-tslint
🔗️ 17k
This linter plugin for SublimeLinter provides an interface to tslint. It will be used with files that have the “typescript” syntax.
- npm 包
tslint
tslint.json
1
2
3
4
5
6
7
8
9{
"defaultSeverity": "error",
"extends": [
"tslint:recommended",
"tslint-config-prettier"
],
"rules": {
}
}
* 格式化
一、 HTML-CSS-JS Prettify
🔗️ 879k
1) 简介
- HTML, CSS, JavaScript, JSON, React and Vue code formatter for Sublime Text 2 and 3 via node.js
- 其对 js 的格式化是 通过 js-beautify 来进行设置的
2) 偏好设置
其 node 路径通过 Packages/node_env.py
来设置1
2
3
4
5
6
7
8
9
10
11
12
13
14
15User\HTMLPrettify.sublime-settings
----------
{
// Simply using `node` without specifying a path sometimes doesn't work :(
// https://github.com/victorporof/Sublime-HTMLPrettify#oh-noez-command-not-found
// http://nodejs.org/#download
"node_path":
{
"windows": "C:/Program Files/nodejs/node.exe",
"linux": "/usr/bin/nodejs",
"osx": "node"
},
// Automatically format when a file is saved.
"format_on_save": false,
}
3) .jsbeautifyrc
格式化规则 🔗️
The plugin looks for a .jsbeautifyrc file in the following directories:
- The same directory as the source file you’re prettifying.
- The source file’s parent directories.
- Your home folder.
- Your personal Sublime settings folder.
二、 JsPrettier
🔗️ 55k
1) 偏好设置
JsPrettier
的偏好设置文件是一些类似设置 node prettier 路径的配置和Prettier Options
选项node prettier
路径有Packages/node_env.py
来设置了,文件中可直接留空1
2
3
4
5
6
7JsPrettier.sublime-settings
----------
"prettier_cli_path": "",
// "prettier_cli_path": "/Users/john/.nvm/versions/node/v10.13.0/bin/prettier",
"node_path": "",
// "node_path": "/Users/john/.nvm/versions/node/v10.13.0/bin/node",
some other config .....
2) Prettier Options
格式化规则 🔗️
三、 JsFormat
🔗️ 666k
1) 简介
JsFormat is a javascript formatting plugin for Sublime Text 2. It uses jsbeautifier to format whole js or json files, or the selected portion(s).
2) 偏好设置
其偏好设置 亦是一些 诸如 auto_formatter
的选项 和 Pretter Options
* 补全
一、 VUE
vue 补全主要依赖于 User\Snippets
中的内容1
2
3// the third library
// the local function and variables
// the local component