Stuk / eslint-plugin-header

ESLint plugin to ensure that files begin with given comment
MIT License
71 stars 36 forks source link

support .vue file #8

Open rensiu opened 7 years ago

rensiu commented 7 years ago

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

alejandroclaro commented 5 years ago

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 commented 5 years ago

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

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 commented 5 years ago

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 commented 4 years ago

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 commented 4 years ago

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

just-at-uber commented 3 years ago

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 Githubissues.

  • Githubissues is a development platform for aggregating issues.