Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support .vue file #8

Open
rensiu opened this issue Apr 6, 2017 · 7 comments
Open

support .vue file #8

rensiu opened this issue Apr 6, 2017 · 7 comments

Comments

@rensiu
Copy link

rensiu commented Apr 6, 2017

It would be nice if this package can support .vue file.
leadingComments[0] is HTML in .vue file.

@alejandroclaro
Copy link

Very good suggestion. I also have the same need to validate copyright headers in vue files and other files such as shell (bash) script files, XML files, etc.

@Stuk
Copy link
Owner

Stuk commented Sep 26, 2019

Afraid I don't use Vue, so have some questions:

  • Does eslint work with .vue files? (I guess yes if you're asking this question)
  • This plugin just checks strings, so can you put an HTML string in the configuration and have it just work?

I'm probably not going to work on this issue, but would accept a PR if it's not too intrusive and much to maintain.

@alejandroclaro
Copy link

alejandroclaro commented Sep 28, 2019

Hi Stuk,

Yes, eslint work with .vue files by using a parser (vue-eslint-parser).

Agreed, it should work, but I noticed that this plugin assumes that first line starts with '/*', and last line ends with '*/'. I think this is a problem in order this plugin to work with comment syntax different to C-like languages. For XML files, this should recognize that the comment start with ''; or no assume anything about how comments start and end.

I will take a look to the code and propose a solution as push request if it helps.

@hansiemithun
Copy link

Hi Stuk,

Yes, eslint work with .vue files by using a parser (vue-eslint-parser).

Agreed, it should work, but I noticed that this plugin assumes that first line starts with '/', and last line ends with '/'. I think this is a problem in order this plugin to work with comment syntax different to C-like languages. For XML files, this should recognize that the comment start with ''; or no assume anything about how comments start and end.

I will take a look to the code and propose a solution as push request if it helps.

Any update on this? Facing similar issue as @Stuk. Not working in vue files

@Stuk
Copy link
Owner

Stuk commented Apr 27, 2020

Afraid I don't have time to look into this. I would appreciate a PR to fix!

@just-at-uber
Copy link

Hi there,

I have a fix that I'm testing locally.
I'll make a fork of the project and post up a PR shortly.

There are some caveats with .vue files which may need more work (such as it crashes if no <script> tag is found, assumes <script> tag is first for .vue files) but at least it's working in some capacity. Hopefully others will find this fix useful.

Thanks!

@just-at-uber
Copy link

Created PR #32

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

No branches or pull requests

5 participants