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 lint don't work properly #417

Open
lifeart opened this issue Nov 22, 2024 · 1 comment · May be fixed by #418
Open

Template lint don't work properly #417

lifeart opened this issue Nov 22, 2024 · 1 comment · May be fixed by #418

Comments

@lifeart
Copy link
Contributor

lifeart commented Nov 22, 2024

Ref: https://discord.com/channels/480462759797063690/483601670685720591/1309384978508939284

Samples:
https://github.com/arthur5005/ember-ts-lint-problems/blob/main/app/components/test.gts

Blueprint:
npx ember-cli@latest new my-app -b @embroider/app-blueprint --typescript --pnpm
gts exists in app/templates

@arthur5005
Copy link

Thanks again for opening this ticket @lifeart. After some digging, I believe I've found the issue.

const linterMeta = project.dependenciesMeta.find((dep) => dep.name === 'ember-template-lint');
const linterVersion = linterMeta?.version.split('.')[0] || 'unknown';

Description

Here the version checking doesn't allow for any of the preceding characters of semver, so if you have a ~ or or a ^ preceding the version number it is read incorrectly.

Which then gets consumed here:

if (templateLintVersion === '5') {
return [documentContent];
}

I downgraded ember-template-lint to 5, and then pinned it to the version explicitly (removing the preceding character) which works around the issue for now.

@NullVoxPopuli NullVoxPopuli linked a pull request Nov 22, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants