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

Self Closing tags #81

Closed
tylerturdenpants opened this issue Jul 27, 2019 · 4 comments
Closed

Self Closing tags #81

tylerturdenpants opened this issue Jul 27, 2019 · 4 comments

Comments

@tylerturdenpants
Copy link
Contributor

One of the tests from https://github.com/ember-codemods/ember-angle-brackets-codemod/

Before ember-template-recast (correct)

input: {{some-component selected=(is-equal this.bar null)}}
output: <SomeComponent @selected={{is-equal this.bar null}} />

After ember-template-recast refactor (incorrect)

input: {{some-component selected=(is-equal this.bar null)}}
output: <SomeComponent @selected={{is-equal this.bar null}}></SomeComponent>
@rwjblue
Copy link
Member

rwjblue commented Jul 29, 2019

FWIW, we key the self closing tags off of selfClosing property on the ElementNode. Can you confirm that ember-angle-brackets-codemod sets that flag?

@tylerturdenpants
Copy link
Contributor Author

I have since fix this on the codemod side.

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Aug 6, 2019

no-implicit-this is encountering this issue -- I don't quite understand what's going on, cause ElementNode doesn't have a transform

  let paramTracker = {
    enter(node) {
      node.blockParams.forEach(param => {
        scopedParams.push(param);
      });
    },

    exit(node) {
      node.blockParams.forEach(() => {
        scopedParams.pop();
      });
    },
  };

  return {
    Program: paramTracker,
    ElementNode: paramTracker,
    // etc

@tylerturdenpants, how'd you solve this?
@rwjblue I did not find an occurrence of selfClosing in the angle-bracket codemod

@tylerturdenpants
Copy link
Contributor Author

tylerturdenpants commented Aug 6, 2019

@NullVoxPopuli it’s on a PR for the recast refactor. ember-codemods/ember-angle-brackets-codemod#97

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

No branches or pull requests

3 participants