-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
StaticType Rule Bugs #35
Comments
repeat.for doesn't work with interfaces imported from other files item.ts
page.ts
page.html
linter output:
|
Template is not checked if the view model class name is different from the view and view model file names. src/profiles/list.ts
src/profiles/list.html
There is no linter issue found. Also about your point "Doesn't follow camel-case convention file <-> class", I think no case convention should be enforced, the same basename of both files should be enough to pair them together. |
Custom elements should be checked. item.ts
item.html
|
Bindable attributes passed to custom elements should be checked. item.ts
item.html
page.ts
page.html
The same applies for value convertors, not only their output, but also their input should be checked. |
An idea to think about: allow only strings (and maybe numbers) in string interpolations?
It could prevent unintentional implicit casting, for example to |
I'd certainly use that. |
yeah that's good idea; could you lift that out as a feature request? I don't think its a bug per se. |
Yeah, of course. #44 |
Boolean not operator reports error.
linter output:
|
ast testing fix inheriting locals ref: #35
with regard to attribute ordering and using a local before it has been declared; <option model.bind = "employee.id" repeat.for="employee of employees" > which can be fixed by using a more (in my view) logical ordering: <option repeat.for="employee of employees" model.bind = "employee.id" > given there are so many issues to work though, I won't be fixing this as yet. |
@EisenbergEffect, do I remember correctly, that different browsers gibe attributes in different order? If I remember correctly, then one browser gave it in the order it was written in source code, and some other browser gave it alphabetically? If so, then we shouldn't rely on the order of attributes, but rather set them on different elements? |
Yes. I don't think you can rely on attribute order. That's one reason why you can't have two template controllers on the same element and have to nest a template. |
But, the above example should work because the template controller overrides everything else and causes the scope to be created. |
@EisenbergEffect, I don't understand Your last message. Do You mean, that the order of
(that would contradict what @MeirionHughes mentioned earlier) |
The order should not matter. The presence of a template controller overrides everything else on the element. However, it makes more sense to have the template controller first. |
Resolved; realized I could simply reorder them now that I pre-process into an AST. |
update README. fix type checking of method return type support javascript sources. closes #52 Migrate conflicting-attribute. closes #32 ensure unknown converters fail silently. Check bindable field is okay. ref #35 Support Syntax Rule configuration Support any attribute order for controllers. ref #35 Support Keyed Access. ref #35 Fix negated if.bind support interpolation within binding. support custom typings. closes #36 reject access to private fields. ref: #35 support ancestor scope with correct context ref: #35 fix view-model resolution. ref: #35 fix inheriting locals ref: #35 update and unlock versions improve unhandled error msg replace repeatfor. closes #40 fix view-model not found rework static-type rule closes #33
update README. fix type checking of method return type support javascript sources. closes #52 Migrate conflicting-attribute. closes #32 ensure unknown converters fail silently. Check bindable field is okay. ref #35 Support Syntax Rule configuration Support any attribute order for controllers. ref #35 Support Keyed Access. ref #35 Fix negated if.bind support interpolation within binding. support custom typings. closes #36 reject access to private fields. ref: #35 support ancestor scope with correct context ref: #35 fix view-model resolution. ref: #35 fix inheriting locals ref: #35 update and unlock versions improve unhandled error msg replace repeatfor. closes #40 fix view-model not found rework static-type rule closes #33
So this is the first feature, that modifies the output compared to the input? |
Nope, nothing changes. The analysis code is basically one big state machine; I've simply re-ordered the attributes in the Syntax Tree, so the template controllers are examined first; presumably only the controllers add local variables. This means if you have The linter (with gulp) does nothing to the output. |
Linting the navigation-skeleton with StaticType analysis shows the error:
The source of this is <canvas class="header-bg" width="250" height="70" blur-image.bind="image"></canvas>
<div class="avatar">
<img src.bind="user.avatar_url" crossorigin ref="image"/>
</div> The thing is, it's binding to the |
I'm getting false positives on vars added through <form id="new" validation-errors="errors.bind: newErrors; controller.bind: newValidationController">
<input type="text" value.bind="new.name & validate"/>
<input type="submit"/>
<p repeat.for="newError of newErrors" class="warning">
${newError.error.message}
</p>
</form> gives:
The simple binding |
Please report any issues you find and I will try to collate and fix them as I can.
Column offsets are always 0Order of Attributes in same element can break bindings to a localsAncestor access doesn't check types i.e.$parent
Capitalised filename should resolve (limited to Foo_ViewModel_ currently)Doesn't follow camel-case convention file <-> classDoesn't support Mapping ex:repeat.for="[id, customer] of customers"
Complains it cannot find converter as field memberShould add$index
,$odd
$even
inside repeat.for as known variablescontext variables aren't overridden in nested controllers (same local name)Doesn't recognise interfaces.repeat.for doesn't work with interfaces imported from other filesTemplate is not checked if the view model class name is differentTraverses into private fields (should be warning).Doesn't support interpolation with attribute valueDoesn't support Keyed AccessDoesn't support negation operator on if.bindBindable attributes passed to custom elements should be checked.Custom elements should be checked.Doesn't support Generics and use of Generic member typesmoved to featureDoesn't support Value Converters (different Type output)moved to featureThe text was updated successfully, but these errors were encountered: