masahiro0104の日記

プログラミング情報メモ

AtomEditor 設定 for Vue.js

download

https://atom.io/

package install

vi packages.txt

japanese-menu
editorconfig
line-ending-converter
auto-convert-to-utf8
file-icons
highlight-selected
              
autoclose-html 
 
language-vue
vue2-autocomplete
vuejs2-snippets
 
hyperclick              
js-hyperclick              
vue-hyperclick              
              
linter              
linter-eslint              
linter-ui-default              
intentions              
busy-signal              

option

vim-mode-plus

apm install --packages-file packages.txt

packages設定

 LF設定

line-ending-selector

Default line ending OS Default => LF

Linter Eslint設定

Fix errros on Saveにチェック

対象追加

source.js, source.jsx, source.js.jsx, source.babel, source.js-semantic, text.html.vue

以降、プロジェクト配下で実行

cd {プロジェクト}

editor config設定。 Vueプロジェクトの丸コピ

vi .editorconfig

# http://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

eslintrc設定

npm install --save-dev eslint eslint-plugin-vue@next
npm install --save-dev eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node

もしくは、適当なところにインストールして、eslint設定のlocal node_modulesにパス設定

vi .eslintrc.js

module.exports = {
  extends: [
    'standard',
    'plugin:vue/recommended'
  ],
  rules: {
    // override/add rules settings here, such as:
    // 'vue/no-unused-vars': 'error'
  }
}```