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

False positive about validateAttributeSeperator with attributes starting with : or @ #13

Closed
iwata opened this issue Jul 1, 2019 · 5 comments
Assignees
Labels
Milestone

Comments

@iwata
Copy link

iwata commented Jul 1, 2019

I'm using v0.3.0.

About this template example,

<template>
b-textarea(
  rows='20'
  :value='body'
  :loading='isProcessing'
  @input='inputBody'
  required
)
</template>

and set this .pug-lintrc.js,

module.exports = {
  validateAttributeSeparator: {
    separator: ', ',
    multiLineSeparator: '\n'
  }
}

This case reports this:

  4:3    Invalid attribute separator found
  5:3    Invalid attribute separator found
  6:3    Invalid attribute separator found

It means that : and @ occurred Invalid attribute separator found errors.

@iwata iwata changed the title False positive about validateAttributeSeperator with attributes starting with colons : False positive about validateAttributeSeperator with attributes starting with : or @ Jul 1, 2019
@pehbehbeh pehbehbeh added the bug label Jul 1, 2019
@pehbehbeh pehbehbeh added this to the 1.x.x milestone Jul 1, 2019
@pehbehbeh pehbehbeh self-assigned this Jul 1, 2019
@pehbehbeh
Copy link
Member

Does this happen with pug-lint itself?

@iwata
Copy link
Author

iwata commented Jul 2, 2019

@pehbehbeh
No, pug-lint-vue about SFC .vue file.
I updated the above code to make it easier to understand as examples.

@SebinSong
Copy link

Hi, I'm currently having the same problem with attributes starting with :. Since, it's a valid syntax from Vue's perspective, I think pug-lint-vue has to consider it valid as well :). Thanks!

@pehbehbeh
Copy link
Member

This is not an issue of pug-lint-vue, but rather an issue of the pug-lint. We cannot fix this because we are simply using pug-lint under the hood. The issue with the Code above is the indentation.

The following .pug-lintrc.js will work (notice the spaces in multiLineSeparator):

module.exports = {
    validateAttributeSeparator: {
        separator: ',',
        multiLineSeparator: '\n  '
    }
}

But you will get problems with multi-level-indentation.

There is also an ongoing issue here: pugjs/pug-lint#157

@pehbehbeh
Copy link
Member

pehbehbeh commented Jul 4, 2019

Also note that : and @ are not the issue here. The following will get you exactly the same errors:

b-textarea(
  rows='20'
  v-bind:value='body'
  v-bind:loading='isProcessing'
  v-on:input='inputBody'
  required
)

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

No branches or pull requests

3 participants