Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Doesn't support v-bind (and possibly v-on) shorthand #7

Closed
danherd opened this issue Feb 21, 2018 · 5 comments · Fixed by #12
Closed

Doesn't support v-bind (and possibly v-on) shorthand #7

danherd opened this issue Feb 21, 2018 · 5 comments · Fixed by #12
Assignees
Milestone

Comments

@danherd
Copy link

danherd commented Feb 21, 2018

This lints fine:

el-form.inline(
  v-bind:model='form'
  v-bind:rules='rules'
  v-bind:ref='formName'
  method='post'
  action=''
  label-position='top'
  status-icon
  v-on:submit.native.prevent='submitForm($event)'
  novalidate
)

This throws an 'Unexpected token' error at the line containing the ':rules' parameter (oddly enough, the previous line with the ':model' parameter is fine)

el-form.inline(
  :model='form'
  :rules='rules'
  :ref='formName'
  method='post'
  action=''
  label-position='top'
  status-icon
  @submit.native.prevent='submitForm($event)'
  novalidate
)

Is this an issue with pug-lint itself, or is it something you can affect with this package?

Cheers!

@coreysan
Copy link

Also experiencing this.

The order doesn't seem to matter. The failing line is always the second colon-prefixed attribute.

@aminimalanimal
Copy link

I've opened a ticket in the pug-lint repo for this. I believe that it is related directly to pug-lint, since I was receiving these syntax errors when running pug-lint itself.

@Shinigami92
Copy link

Omg, I think I found the problem ...
Since we do not use a comma to split the attributes, pug assumes that it's JavaScript syntax
So if we split the attributes with a comma, the syntax error is gone

... took me some hours ...

@aminimalanimal
Copy link

This issue was prematurely closed—there shouldn't be a need to add commas to each line. The good folks at pug-lint found the underlying issue and the above PR should take care of it. :)

@pehbehbeh
Copy link
Member

Will be fixed in next release.

@pehbehbeh pehbehbeh modified the milestones: 0.2.0, 0.3.0 Jun 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants