-
Notifications
You must be signed in to change notification settings - Fork 53
Component templates in addon are not linted #292
Comments
I don't understand the question? If an addon includes |
Templates inside Am I incorrect to expect templates inside |
Ya, it was a bug, but it was fixed on newer Ember-cli versions I believe. What version are you using? |
Hmm, I was thinking of ember-cli/ember-cli#7119 (and ember-cli/ember-cli#7369), but I don’t think I fixed templates in an addons app there... Would definitely accept a PR upstream to fix... |
I'll give it a try. |
Just to keep you informed: I started working on this and already have a broad idea of how this should be done, but I had to focus on some other work related issues. I'm still on it. |
@rwjblue I seem to be stuck on it, there might be a bigger issue to solve. Or maybe I'm just not quite understanding what's going on here. So as I understand it, I must add a proper funnel to I am able to do that by adding this code to method:
But this seems to override previous adding of templates from the I tried adding those templates in multiple ways, but I can always only have the templates from either I also tried returning all of them from I suspect that this might come from this line:
overriding this:
from here: https://github.com/ember-cli/ember-cli/blob/master/lib/models/addon.js#L1113 Or, more specifically, the last Funnell tree concatenated into the return value gets accepted as the tree with the templates, overriding previous ones. Even when they have different This is where I'm stuck, and would love to hear some feedback. Am I missing something obvious and simple, or is there a deeper issue to solve? |
@billybonks I think you touched some of that code lately. Any idea about this? |
i do have a few ideas, let me explore the issues identified here and get back to you. btw i resolve all these issues with billybonks/ember-cli-stylelint#73. i pretend that lintTree only ever gets called once and fetch everything that i want :), or that the user configures. |
I would guess more people are going to start running into this now that template-lint is part of the default addon blueprint. The |
We have route templates in |
For anyone who trips up on this. ember-cli/ember-cli#7887 (comment) ⬆️ That seems to work for me. const { WatchedDir } = require('broccoli-source');
const templatesPath = `${__dirname}/addon/components`;
const templatesTree = new WatchedDir(templatesPath);
module.exports = function(defaults) {
const app = new EmberAddon(defaults, {
trees: {
templates: templatesTree
}
});
return app.toTree();
}; |
TBH, I'd suggest using |
Totally on board with |
@dfreeman I think I am lumping ember-cli-template-lint into the same category as ember-cli-eslint, and am assuming it will be removed from the blueprint in favor of |
Sorry @sangm, I wasn’t suggesting that the RFC change at all, just that this library is likely to follow whatever the decision that is made there (it is nearly the same exact situation). |
We would like to lint templates of components in an addon, but they don't seem to be linted. ESLint is not linting in addons too, unless one specifies
in
index.js
, which we do. Is there any way of enabling this feature?The text was updated successfully, but these errors were encountered: