kendo-lint

'A static analysis (linting) tool that checks your usage of Kendo UI objects'

kendo-lint

A static analysis (linting) tool that checks your usage of Kendo UI objects... automatically!

kendo-lint was designed to inspect your Kendo UI configurations in a terminal environment with Node.js

kendo-lint currently depends on the following libraries:

  • Node
  • NPM
  • UglifyJS
  • Glob
  • Markdown
  • Optimist

kendo-lint has not been tested against any other versions of these libraries. You may find that versions other than these are compatible with kendo-lint, but we make no claims to support those version, nor can we troubleshoot issues that arise when using those versions.

npm install -g kendo-lint
kendo-lint [options] [files]

If no file names are given, it will read from STDIN. By default it parses STDIN as JavaScript, pass --html to parse as HTML.

When file names are passed, the type will be determined from the extension, but it can be forced with either --js or --html.

To output results as a JSON array, pass --json.

var kendoLint = require("kendo-lint");
var results = kendoLint.lintJS(code, filename);

Use this if you already have the code in memory. No file is read, the filename argument is just included in the results array, which will contain objects like this:

{ filename: filename,
  message: "Warning message",
  line: the line number,
  col: the column }

Pass the full path to the file to lint. Your callback is invoked with two arguments, error and results.

Use this to lint HTML code. It's similar to lintJS, except that for the time being we cannot report line/column information.

Similar to lintJSFile, but for HTML code.

The Kendo linting tool will search for code that constructs Kendo widgets, and check the passed options against the API documentation. Any mismatches are reported (invalid option name, or invalid type for option).

For JavaScript it looks for code like this:

(...).kendoWidgetName({ ... })

and check the options inside the brackets. It checks nested options too.

For HTML it searches MVVM constructs, like:

<div data-role="widget-name" data-option="..."> ... </div>

and tries to validate the widget name and given options against known API. However,