-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
[gjs-gts-parser] fix parsing when there are multiple default <template>
blocks (not allowed)
#2005
Conversation
Can you provide some context about this in the PR description? |
@@ -91,6 +91,10 @@ const valid = [ | |||
<template> | |||
<div {{on 'click' noop}} /> | |||
</template> | |||
|
|||
<template> | |||
<div {{on 'click' noop}} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bmish this is the bad code -- can't have two default templates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bmish it would have failed to parse it without this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide some context about the actual fix too? What was wrong before and how does your change fix it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before i would have converted the template parts to template string literals.
`
Tpl1
`
`
Tpl2
`
But that makes it one tagged template literal... Instead of 2 separates.
Now i make them tagged already.
""
`
Tpl1
`
""
`
Tpl2
`
I use string as tag name, as otherwise eslint would complain about missing references to identifiers
* master: (46 commits) fix gts type aware by emulating them to ts files set our own ts.sys with ts.setSys typescript-eslint has handling for a lot of scenarios for file changes and project changes etc use mts extension to keep same offsets we also sync the mts with the gts files Switch to ESLint flat config internally (ember-cli#2018) [gjs-gts-parser] fix parsing when there are multiple default <template> blocks (not allowed) (ember-cli#2005) Release 12.0.0-alpha.2 fix locations after template reference tag name parts (split up with dot) instead of whole tag add failing test Release 12.0.0-alpha.1 docs: recommended-gts/gjs instead of gts/gjs-recommended add rule to gjs & gts build(deps-dev): Bump eslint from 8.52.0 to 8.53.0 build(deps-dev): Bump npm-package-json-lint from 7.0.0 to 7.1.0 build(deps-dev): Bump eslint-doc-generator from 1.5.3 to 1.5.4 Update `@typescript-eslint/` dependencies to v6 (ember-cli#1984) Fix missing gjs/cts config icons (ember-cli#1982) improve gts gjs configuration example Release 12.0.0-alpha.0 Switch to `@release-it-plugins/lerna-changelog` (ember-cli#1979) Set config `ecmaVersion` to `2022` (ember-cli#1978) Add new `recommended` rule: `template-no-let-reference` (ember-cli#1977) ...
<template>
blocks (not allowed)
I encountered this while working on implementing content-tag for prettier plugin, which has tests for multiple default templates.
It would fail to parse the file in that case.
Before i would have converted the template parts to template string literals.
But that makes it one tagged template literal... Instead of 2 separates.
Now i make them tagged already.
I use string as tag name, as otherwise eslint would complain about missing references to identifiers