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

<template> tag parsing issue in templates shorter than 3 characters #1894

Closed
chancancode opened this issue Jun 20, 2023 · 1 comment · Fixed by #1920 or #1942
Closed

<template> tag parsing issue in templates shorter than 3 characters #1894

chancancode opened this issue Jun 20, 2023 · 1 comment · Fixed by #1920 or #1942
Labels

Comments

@chancancode
Copy link

  1. ember new --yarn zomg, as of now that gives you:
    1. ember-cli@5.0.0
    2. eslint@8.43.0
    3. eslint-plugin-ember@11.8.0
  2. Disable prettier integration (to isolate the problem to eslint):
    1. Remove eslint-config-prettier package
    2. Remove eslint-plugin-prettier package
    3. Remove extends plugin:prettier/recommended
    4. yarn
  3. Add app/components/foo.gjs with the following content
  4. Run yarn lint:js (which is eslint . --cache)

0 characters

export default <template></template>;
/private/tmp/zomg/app/components/foo.gjs
  0:0  error  Preprocessing error: Cannot split a chunk that has already been edited (1:13 – "</template>")

✖ 1 problem (1 error, 0 warnings)

1 character

export default <template>h</template>;
/private/tmp/zomg/app/components/foo.gjs
  0:0  error  Preprocessing error: Cannot overwrite across a split point

✖ 1 problem (1 error, 0 warnings)

2 characters

export default <template>hi</template>;
/private/tmp/zomg/app/components/foo.gjs
  0:0  error  Preprocessing error: Cannot overwrite a zero-length range – use appendLeft or prependRight instead

✖ 1 problem (1 error, 0 warnings)

3 characters

export default <template>hi!</template>;
✨  Done in 0.59s.

(The result is the same if you put the template tag inside a class body)

@bmish
Copy link
Member

bmish commented Aug 22, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants