aurelia / template-lint

Sanity check of Aurelia-flavor template HTML
Apache License 2.0
56 stars 17 forks source link

resolveViewModel should report file name if it can't find a class #145

Closed timfish closed 7 years ago

timfish commented 7 years ago

I'm using gulp-aurelia-template-lint@0.9.1

But it's tripping up due to the following code in binding.ts:

    let first = classes[0];
    let context = new ASTContext();

    context.name = first.name.getText();

I can't for the life of me work out which file its having problems with. I'm guessing I have an empty file somewhere? Would be helpful to have a file path!

C:\Users\tim\Documents\My-Project\node_modules\aurelia-template-lint\dist\rules\binding.js:213
        context.name = first.name.getText();
                            ^

TypeError: Cannot read property 'name' of undefined
    at BindingRule.resolveViewModel (C:\Users\tim\Documents\My-Project\node_modules\aurelia-template-lint\dist\rules\binding.js:213:29)
    at BindingRule.init (C:\Users\tim\Documents\My-Project\node_modules\aurelia-template-lint\dist\rules\binding.js:23:34)
  ... snip
MeirionHughes commented 7 years ago

I'll try and triage asap

MeirionHughes commented 7 years ago

Try 0.9.20; it should stop complaining that it cannot find the view model; as of 0.9.20 the default config is not to complain. As for your case, it seems its finding the source file but cannot find any classes in it.