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

fails to process when missing semi #37

Open
patricklx opened this issue Nov 3, 2023 · 5 comments
Open

fails to process when missing semi #37

patricklx opened this issue Nov 3, 2023 · 5 comments

Comments

@patricklx
Copy link

patricklx commented Nov 3, 2023

ember-tooling/prettier-plugin-ember-template-tag#162

const num:   number = 1
(oops) => {}
import Component from '@glimmer/component'

/** It's a component */
class MyComponent
  extends Component {
    get whatever() {}

        <template>


    <h1>   Class top level template. Class top level template. Class top level template. Class top level template. Class top level template. </h1>
  </template>
  (oops) => {}
}
import type { TemplateOnlyComponent } from '@ember/component/template-only'

export interface Signature {
  Element: HTMLElement,
  Args: {


  }
  Yields: []
}


export const Exported:    TemplateOnlyComponent<Signature> = <template>       Exported variable template. Exported variable template.  Exported variable template.  Exported variable template.  Exported variable template. Exported variable template. Exported variable template. </template>
(oops) => {}
@patricklx
Copy link
Author

mmm, just was testing this on astexplorer and its also not working...
typescript can parse it, but joins in into the initializer

@patricklx patricklx reopened this Nov 3, 2023
@patricklx
Copy link
Author

I think content tag should be able to parse at least the ones with the template+ missing semi

@patricklx
Copy link
Author

@ef4

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Nov 9, 2023

that second case isn't valid even without <template>
like, you can't have

let a = 1
() => {}

You get:

Uncaught SyntaxError: invalid arrow-function arguments (parentheses around the arrow-function may help)

And following FireFox's advice:

let a = 1
(() => {})

Uncaught TypeError: 1 is not a function

(this is also more evidence that ASI is a bad idea (or at least one that didn't work out))

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Nov 9, 2023

Made a failing test PR from the first example, tho: #38
(which, I think makes sense, because you can't have <template></template>() )

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

2 participants