Skip to content
New issue

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

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

Already on GitHub? # to your account

WIP: invalid indentation for multiline <Form::Element> (failing test) #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jelhan
Copy link
Contributor

@jelhan jelhan commented May 31, 2020

This adds a failing test that indentation is invalid (accordingly to default template linting) if <Form::Element> uses multiple lines for it's arguments and attributes on input:

Taking this input:

<form.element
  @property="foo">
  @placeholder="foo">
/>

I would expect an output, which passes template linting. An example would be:

<form.element
  @property="foo"
  as |el|
>
  <el.control placeholder="foo" />
</form.element>

But I see this one as demonstrated by failing test:

<form.element
  @property="foo"
as |el|><el.control placeholder="foo" /></form.element>

Template linter throws errors due to indentation of </form.element> and <el.control />.

This adds a failing test that indentation is invalid (accordingly to
default template linting) if `<Form::Element>` uses multiple lines for
it's arguments and attributes on input:

Taking this input:

```hbs
<form.element
  @Property="foo">
  @Placeholder="foo">
/>
```

I would expect an output, which passes template linting. An example
would be:

```hbs
<form.element
  @Property="foo"
  as |el|
>
  <el.control placeholder="foo" />
</form.element>
```

But I see this one as demonstrated by failing test:

```hbs
<form.element
  @Property="foo"
as |el|><el.control placeholder="foo" /></form.element>
```

Template linter throws errors due to indentation of `</form.element>`
and `<el.control />`.
@simonihmig
Copy link
Contributor

Confirmed. But I believe there is not much we can do about it. Related: ember-template-lint/ember-template-recast#82

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

Successfully merging this pull request may close these issues.

2 participants