Eslint-plugin-vue: Should disable vue/html-indent within pre elements

Created on 26 Jan 2018  路  1Comment  路  Source: vuejs/eslint-plugin-vue

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

$ npm list | grep eslint
+-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
| +-- [email protected] deduped
| +-- [email protected] deduped
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
| `-- [email protected]
|   +-- [email protected] deduped
|   +-- [email protected] deduped
| +-- @sheerun/[email protected]
| +-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected]
| | +-- [email protected] deduped
| | `-- [email protected]

$ node --version
v8.9.0

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

bug

Most helpful comment

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

casprwang picture casprwang  路  4Comments

rodneyrehm picture rodneyrehm  路  4Comments

maple-leaf picture maple-leaf  路  3Comments

Hyzual picture Hyzual  路  3Comments

nirazul picture nirazul  路  3Comments