Shinigami92 / eslint-plugin-vue-pug-sfc

eslint plugin vue pug sfc
https://www.npmjs.com/package/eslint-plugin-vue-pug-sfc
MIT License
32 stars 4 forks source link

Mutliline Backtick Support #145

Open juakotorres opened 2 years ago

juakotorres commented 2 years ago

Request / Idea

Before the pug warnings or errors, I got multiple warnings like this:

Please report token: {"type":"attribute","loc":{"start":{"line":26,"column":5},"end":{"line":31,"column":7}},"name":":rules","val":"`[\n      v => $v.form.email.required,\n      v => $v.form.email.email,\n      v => $v.form.email.maxLength,\n      v => $v.form.email.validOnServer,\n    ]`","mustEscape":true}

It does not affect the library functionalities, but it could be nice to have the support. For example when you use validation libraries.

Input

input("email", "email", "email", "EMAIL")(
  v-model.trim="form.name"
  :rules=`[
    v => $v.form.email.required,
    v => $v.form.email.email,
    v => $v.form.email.maxLength,
    v => $v.form.email.validOnServer,
  ]`
)

Expected Output

No report token log.

Additional Context

Grawl commented 2 years ago

have the same issue with Vue

    TwoPaneForm(
        :input='store.text'
        :input-is-invalid-label=`$t('rewriter.invalid-source', {
            min: validationRules.minimumWords,
            max: $tc('count.words', validationRules.maximumWords),
        })`
        :input-validator='textIsValid'
        :input-placeholder=`$t('rewriter.source-placeholder')`
        :result-input-classes=`{ '_sentences': enableSentencesModel }`
        :result-is-empty='!hasRewritten'
        v-bind='{ textIsChanged, isEmpty }'
        :loading='store.loading'
        @input='setText($event)'
    )
Please report token: {"type":"attribute","loc":{"start":{"line":8,"column":3},"end":{"line":11,"column":6}},"name":":input-is-invalid-label","val":"`$t('rewriter.inva
Shinigami92 commented 2 years ago

The line is here https://github.com/Shinigami92/eslint-plugin-vue-pug-sfc/blob/99c0c01b35d658c95b9fe2c40185b153002f21ae/src/utils/index.ts#L335

Who wants to help and setup a PR for that?

Grawl commented 2 years ago

i have no background in tool development, sorry :( just a frontend designer, more tied with Figma than Typescript