前回メモしたやつがいまいちなのでやり直し
Install Emacs package
(flycheckはインストール済みの前提で)
M-x package-list-packages で add-node-modules-path をインストール
package.json
{ "name": "hoge", "version": "1.0.0", "description": "hoge project", "author": "Hoge Hogeo <hoge@gmail.com>", "private": true, }, "devDependencies": { "eslint": "^4.19.1", "eslint-plugin-vue": "^4.7.0" } }
.eslintrc.js
module.exports = { root: true, env: { browser: true, node: true }, extends: [ 'eslint:recommended', 'plugin:vue/recommended', ], plugins: [ 'vue' ], }
plugins に vue
入れなくてもうごくけど
init.el
(add-hook 'web-mode-hook (lambda () (flycheck-add-mode 'javascript-eslint 'web-mode) (flycheck-mode -1) (when (and (stringp buffer-file-name) (string-match "\\.vue\\'" buffer-file-name)) (flycheck-add-mode 'javascript-eslint 'web-mode) (flycheck-mode)) ) ))
感想
npm は依存関係がひどくてつらい