eslint-plugin-vue-pug-sfc icon indicating copy to clipboard operation
eslint-plugin-vue-pug-sfc copied to clipboard

Mutliline Backtick Support

Open juakotorres opened this issue 3 years ago • 3 comments

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

juakotorres avatar Jan 17 '22 02:01 juakotorres

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

Grawl avatar Jan 24 '22 05:01 Grawl

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?

Shinigami92 avatar Jan 24 '22 08:01 Shinigami92

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

Grawl avatar Jan 24 '22 09:01 Grawl