ember-cli / ember-cli/ember-template-imports

Issues with semi-colons?

Open
#227 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
77
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Historically we've disabled semi-colons in our eslint/prettier setup (but it's not really important for us to keep it that way), and I think I'm finding that ember-template-imports requires/assumes you're using semi colons due to the following:

```gts
export default class StarRating2Component extends GlimmerComponent {
ratings = [1, 2, 3, 4, 5]



...


}
```

yields error

```
[0] 20 |SyntaxError: /Users/machty/code/fpr/fpr-ember/packages/@futureproofretail/shopper-app/@futureproofretail/shopper-app/components/star-rating-2.ts: Attempted to use `` to define a template in an unsupported way. Templates defined using this syntax must be:
[0]
[0] 1. Assigned to a variable declaration OR
[0] 2. The default export of a file OR
[0] 2. In the top level of the file on their own (sugar for `export default`) OR
[0] 4. Used directly within a named class body
[0] 15 |
[0] 16 | export default class StarRating2Component extends GlimmerComponent {
[0] > 17 | ratings = [1, 2, 3, 4, 5]
[0] | ^
[0] 18 |
[0] 19 |
[0] 20 |
[0] at File.buildCodeFrameError (/Users/machty/code/fpr/fpr-ember/node_modules/.pnpm/@babel+core@7.23.7/node_modules/@babel/core/lib/transformation/file/file.js:205:12)
```

If I add a semi-colon after `ratings`, it compiles.

I searched this repo for "semi-colon" and this is the only issue comment that turned up: https://github.com/ember-template-imports/ember-template-imports/issues/31

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.