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

Use file path to lint template #35

Merged
merged 1 commit into from
Aug 16, 2021

Conversation

bobisjan
Copy link
Contributor

@bobisjan bobisjan commented Feb 25, 2020

This PR fixes error The "path" argument must be of type string. Received type undefined introduced by this fix 🙈.

fixes ember-template-lint/ember-template-lint#1161

@@ -75,7 +75,7 @@ module.exports = {
if (node.quasi.type === 'TemplateLiteral') {
let hbs = node.quasi.quasis[0].value.cooked
hbs = unindentAndStripSafeNewlines(hbs)
const results = linter.verify({source: hbs.toString(), moduleId: context.id})
const results = linter.verify({source: hbs.toString(), filePath: context.id, moduleId: context.id})
Copy link

@jaydgruber jaydgruber Mar 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const results = linter.verify({source: hbs.toString(), filePath: context.id, moduleId: context.id})
const results = linter.verify({source: hbs.toString(), filePath: context.getFilename(), moduleId: context.id})

based on eslint docs, context.id seems like the wrong thing here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shame this was merged without this fix; I just hit #40 as well and came to the same conclusion—context.id is just the rule name check-hbs-template-literals, which doesn't really make sense as the filePath or moduleId

@jaydgruber
Copy link

I think this would resolve #40 w/ the suggested change.

@psbanka psbanka merged commit c32e5b6 into ember-template-lint:master Aug 16, 2021
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 this pull request may close these issues.

Does ember-template-lint v2 support ESLint integration?
4 participants