Open RomkeVdMeulen opened 7 years ago
Its possible your import statement is the problem as inheritance should be supported: https://github.com/MeirionHughes/aurelia-template-lint/commit/7f941b9f05b8b3dd458d98f20594f11342883dc5
That could be it: I'm not importing with a relative path. I have updated my original post to show how I import Toggle
.
Yes, that's it. I think you'll need to use relative paths. Unless I'm mistaken "src/components/toggle" means /components/toggle
from within src
module. If this is what you're trying doing then support for modules at the moment is done via setting the typings path - not tested with node_modules/@types though.
Using relative paths isn't a good option for my project. src
isn't an external module in my case, it refers to code under the src
dir in my codebase. I'm using the TypeScript baseURL compiler option to make this work.
In this case the module path I'm importing from matches what I passed to reflectionOpts.sourceFileGlob
. Which is:
config.reflectionOpts.sourceFileGlob = "src/**/*.ts";
I can understand that following complex module resolution logic is a bit out of scope for a template linter. But perhaps it might be a useful feature to try to resolve non-relative imports that match the sourceFileGlob
?
resolution:
original:
Not very common, but sometimes I have something like: src/components/my-widget.ts:
src/components/toggle.ts:
src/components/my-widget.html:
In which case the linter should not report
WARNING: cannot find 'toggle' in type 'MyWidget' Ln 2 Col 3 my-widget.html
orWARNING: cannot find 'toggled' in type 'MyWidget' Ln 3 Col 3 my-widget.html
.