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

feat(lint): parse inline templates #90

Merged
merged 12 commits into from
Sep 20, 2016
Merged

feat(lint): parse inline templates #90

merged 12 commits into from
Sep 20, 2016

Conversation

mgechev
Copy link
Owner

@mgechev mgechev commented Sep 18, 2016

This PR contains slightly more stuff that it is supposed to so I'll be more explicit with the explanation of the changes:

  • - Template support. We now parse inline templates with the Angular TemplateParser and perform linting over them. There are a couple of limitations:
    • We support only inline templates. Plugging support for external templates is a topic for another discussion but the current PR introduces pretty solid base for this.
    • We don't provide very precise position of where the error has occurred. At this point because of not very detailed information in the sourceSpan in the nodes produced by the TemplateParser we cannot get very accurate information about where the actual linting error is. This issue is tracked by fix(template): mark the entire expression as invalid when the linter finds an error #88.
  • - Linting for src/**/*.ts and test/**/*.ts. Since the project gained some popularity recently (7-8k downloads per day on npm), it'll be good to enforce some common coding style. In other words, I took the tslint.json from angular2-seed and placed it here. This task will be also run in CI (currently the CI fails because the task will be introduced by this branch).
  • - Aligns to the style rules introduced by tslint.json.

@mgechev mgechev force-pushed the templates branch 2 times, most recently from 9e884f6 to b5c91fb Compare September 18, 2016 01:44
@mgechev mgechev added this to the Beta 1 milestone Sep 18, 2016
Copy link
Collaborator

@preslavsh preslavsh left a comment

Choose a reason for hiding this comment

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

During the testing, I found problems with parsing
templates when pipes are not declared in same scope.
The other issue that I found was problem parsing "object.property" expressions .

@mgechev mgechev merged commit 4347d09 into master Sep 20, 2016
@mgechev mgechev deleted the templates branch September 20, 2016 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants