Skip to content
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

fix order of html tags when if in key block #5685

Merged

Conversation

tanhauhau
Copy link
Member

Fixes #5680

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with npm test and lint the project with npm run lint

@tanhauhau tanhauhau force-pushed the tanhauhau/gh-5680-if-in-key-block branch from 309d691 to 002ffa2 Compare November 17, 2020 15:40
<div>Second</div>
</section>

<button on:click={changeNum}>Click</button>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint enforces a new line at the end of files, but it looks like we have only set it up to run against js and ts files (probably because we have some .svelte files in the test with purposefully malformed content for testing)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint-plugin-svelte3 wouldn't complain about this anyway. The linting rules just apply to the parts that are JS (the script tags and the template expressions), and it doesn't extrapolate any of them to the component itself.

@Conduitry
Copy link
Member

@benmccann I see you added the feature: each tag to this. I don't have especially strong opinions about this, but this issue/PR is actually about {#key}, not a keyed {#each}. Did you pick feature: each because it seemed like the best fit out of what there is currently? Might a new tag be warranted?

@Conduitry Conduitry merged commit 24c44b9 into sveltejs:master Nov 23, 2020
@benmccann
Copy link
Member

Ah, yeah. I didn't look that closely and assumed it was keyed each especially since it was the closest match. I didn't realize there was a key feature. We could add a new label, but I think the existing labels might be a bit granular and a better solution could be to come up with some higher-level categories for the labels to use

taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Order of html tags changes when using key > if
3 participants