Skip to content

Should disable vue/html-indent within pre elements #365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sullivanpt opened this issue Jan 26, 2018 · 1 comment · Fixed by #366
Closed

Should disable vue/html-indent within pre elements #365

sullivanpt opened this issue Jan 26, 2018 · 1 comment · Fixed by #366
Labels

Comments

@sullivanpt
Copy link

By default the HTML 'pre' element contents are validated by the vue/html-indent rules. I can work around this by manually adding pre to the ignores array in the rule definition, or by wrapping 'pre' in eslint-disable commands, but it seems 'pre' should be ignored by default.

Tell us about your environment

What did you do? Please include the actual source code causing the issue.

<template>
  <pre>
some preformatted
text here
  </pre>
<template>

What did you expect to happen?

I expected no linter errors

What actually happened? Please include the actual, raw output from ESLint.

44:1 error Expected indentation of 10 spaces but found 2 spaces vue/html-indent

@mysticatea mysticatea added the bug label Jan 28, 2018
@mysticatea
Copy link
Member

Thank you for the report.

I confirmed it.
For now, you can use ignores option for a workaround.

"vue/html-indent": [
  "error",
  2,
  { "ignores": ["VElement[name=pre].children"] }
]

Online demo

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

Successfully merging a pull request may close this issue.

2 participants