0.3.5 • Published 10 years ago

ng-attr-hint v0.3.5

Weekly downloads
5
License
MIT
Repository
github
Last release
10 years ago

ng-attr-hint

npm version license

A static linting tool for angular ng directives.

Usage

Install from npm

npm install ng-attr-hint

var ngAttrHint = require('ng-attr-hint');

// callback
ngAttrHint({
	files: ['./*.html']
}, function(err, res) {
	if(err) console.error(err);
	else  {
		ngAttrHint.format(data).forEach(function(o) {
			console.log(o)
		});
	}
});

// promise
ngAttrHint({
	files: ['./*.html']
}).then(function(data) {
	ngAttrHint.format(data).forEach(function(o) {
		console.log(o)
	});
}, function(err) {
	console.error(err)
});

Output of Gulp task

ng-attr-hint

API

function(options, callback)

Constructor which takes options and an optional callback. if callback is not provided, function will return a promise instance.

Parameters:

options
  {
    files: "glob filename-pattern" || [glob filename-pattern],
		data: "content"
  }

callback
  Optional function which will be used to return the array of hint object.

function format(hints, formatPattern)

format the hint object to array of strings

Parameters:

hints
  Output of ngAttrHint (An array of hint objects)
formatPattern
  Optional Paramater. formatPattern, if provided, will be used for formatting.
  Use '{field}' to interpolate hint object.
  Default pattern : '[{file}:{line}] [{type}] ({attrs}) {message}'

ngAttrHint object format:

{
  file: string,
  line: number,
  type: string,
  attrs: [string],
  message: string
}

Plugins

Gulp task

Grunt Plugin

Atom Package

atom-ng-attr-hint

TODOs

  • Unit tests
  • demo page

License

This plugin is licensed under the MIT license.

Copyright (c) 2015 Prince John Wesley

0.3.5

10 years ago

0.3.4

10 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.10

10 years ago

0.2.9

10 years ago

0.2.8

10 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago