AdamNiederer / vue-mode

Emacs major mode for vue.js
GNU General Public License v2.0
330 stars 61 forks source link

vue-mode and Flycheck #15

Open benjcal opened 7 years ago

benjcal commented 7 years ago

I'm new to Emacs and have been trying for a while to get vue-mode to work with flycheck. I'm not sure if the problem is with flycheck or with vue-mode but have you guys been able to make it work? if not with flycheck, with other linter?

Thanks!

xcodebuild commented 7 years ago

It's sad that may be difficult because of https://github.com/flycheck/flycheck/issues/349.

Use web-mode maybe a good idea.

troglotit commented 7 years ago

I wouldn't say that that's really hard or impossible. Eslint already has plugin for *.vue files, and we just have to create checker for flycheck which treats vue files as another language for which just happens we have eslint. That issue was referencing some feature for Flycheck's ability to treat mmm-mode as a special case and calling different checkers, which is kinda hard

algking commented 5 years ago

@troglotit This is possible, and I use flycheck-eslint for vue one page component development


(add-hook 'vue-mode-hook (flycheck-select-checker 'javascript-eslint))
(setq mmm-vue-html-mode-exit-hook (lambda () 
                                (message "Run when leaving vue-html mode")
                                (emmet-mode -1)))
(setq mmm-vue-html-mode-enter-hook (lambda () 
                                (message "Run when entering vue-html mode")
                                (emmet-mode 1)))