Skip to content
This repository has been archived by the owner on Apr 15, 2018. It is now read-only.

Whether can support html or vue script tag #8

Open
jing2si opened this issue Apr 13, 2017 · 4 comments
Open

Whether can support html or vue script tag #8

jing2si opened this issue Apr 13, 2017 · 4 comments

Comments

@jing2si
Copy link

jing2si commented Apr 13, 2017

All in title.

@ryh
Copy link

ryh commented Apr 13, 2017

Yeah, I got this Language is not valid as well (for .vue file).
And I already put plugin into .eslintrc.js

plugins: [
    'html','vue'
  ],

@RobinMalfait
Copy link
Owner

So the extension is .vue are there other extensions?
I don't know if .html is a good plan though... 🤔

@ryh
Copy link

ryh commented Apr 14, 2017

there are great variety file extension for users , for example I use .vue (Vue) .blade.php (Laravel Blade) but some may not. I suggest add a config for user to define the VALID_LANG

what I tried

  • copy the js in .vue into a standalone .js file then use the extension , worked well.
  • clone this repo and change const VALID_LANG: DocumentSelector = ['javascript', 'javascriptreact', 'html', 'vue'];, then vsce package and install . worked in selecting the js code and prettier. but reported prettier-eslint [ERROR]: prettier formatting failed due to a prettier error while using the prettier to the .vue document (without selecting)

Repository owner locked and limited conversation to collaborators Apr 14, 2017
Repository owner unlocked this conversation Apr 14, 2017
@RobinMalfait
Copy link
Owner

The reason it errors, is because there are multiple 'languages' in the file. So prettier takes in the whole file (or selection) but it sees html tags like <script> and it fails. We just have to figure out a way to detect <script/> tags inside the page, if it is a .vue or .html file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants