7.0.1 • Published 6 months ago

html-validate-angular v7.0.1

Weekly downloads
394
License
MIT
Repository
gitlab
Last release
6 months ago

html-validate-angular

pipeline status coverage report

Angular (2.x and later) and AngularJS (1.x) support for html-validate.

  • Extracts templates from components and routes with inline templates.
  • Angular 2.x or later: Transforms property and attribute bindings in HTML.
  • Angular 1.x: Transforms interpolated attributes (including ng-attr-*) in HTML.
  • Handles dynamic bindings for rules checking presence of text.

Typescript is not yet supported. Help wanted

Usage

npm install --save-dev html-validate-angular

In .htmlvalidate.json:

{
  "plugins": ["html-validate-angular"],
  "transform": {
    "^.*\\.html$": "html-validate-angular:html",
    "^.*\\.js$": "html-validate-angular:js"
  }
}

HTML processing is optional but is needed when attribute interpolation is used.

Example

export const FooComponent = {
  template: "<button>foo</button>",
};
export function routeConfig($routeProvider) {
  $routeProvider.when("/route", { template: "<p>foo</i>" });
}

In both cases it will allow html-validate to parse and detect errors in the templates:

component.js
  2:13  error  Button is missing type attribute  button-type

route.js
  2:51  error  Mismatched close-tag, expected '</p>' but found '</i>'  close-order
6.0.0

6 months ago

7.0.0

6 months ago

7.0.1

6 months ago

5.1.0

9 months ago

5.0.0

2 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.9.0

5 years ago

2.8.6

5 years ago

2.8.5

5 years ago

2.8.4

5 years ago

2.8.3

5 years ago

2.8.2

5 years ago

2.8.1

5 years ago

2.8.0

6 years ago

2.7.0

6 years ago

2.6.3

6 years ago

2.6.2

6 years ago

2.6.1

6 years ago

2.6.0

6 years ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago