npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kendo-lint

v0.2.3

Published

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

Downloads

12

Readme

kendo-lint

About kendo-lint

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

Compatibility and Requirements

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.

Installation

npm install -g kendo-lint

Usage (command-line)

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.

API

var kendoLint = require("kendo-lint");

lintJS(code, filename)

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 }

lintJSFile(filename, callback)

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

lintHTML(code, filename)

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

lintHTMLFile(filename, callback)

Similar to lintJSFile, but for HTML code.

What it does

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, tags are treated specially in HTML, specifically:

  • if there is no src attribute, and there is no type or there is a type that indicates that the content is JavaScript, then the content will be linted via lintJSFile.

  • if there is a type attribute containing the string "template" it will assume that the template generates some kind of HTML, so the content will be linted via lintHTMLFile.

To update the API documentation

As mentioned, the linter relies on knowledge it gets from the Kendo API documentation, so it will be as good as the docs. The data is stored in lib/api.json. To update this file, pass --parse-docs /path/to/kendo-docs-repo.

How to Contribute

If you would like to contribute to kendo-lint's source code, please read the [guidelines for pull requests and contributions] CONTRIBUTING.md). Following these guidelines will help make your contributions easier to bring in to the next release.

Getting Help

Use this section to list ways that a developer can obtain help or support for this project, for instance, Stack Overflow. Make sure to also leave the following section:

As a part of Kendo UI Labs, kendo-lint is intended to be a community-run project, and not an official part of any Kendo UI SKU (Web, DataViz, Mobile or Complete). As such, this project is not a supported part of Kendo UI, and is not covered under the support agreements for Kendo UI license holders. Please do not create support requests for this project, as these will be immediately closed and you'll be directed to post your question on a community forum.

Release Notes

For change logs and release notes, see the changelog file.

License Information

This project has been released under the Apache License, version 2.0, the text of which is included below. This license applies ONLY to the project-specific source of each repository and does not extend to Kendo UI itself, or any other 3rd party libraries used in a repository. For licensing information about Kendo UI, see the License Agreements page at KendoUI.com.

Copyright © 2013 Telerik

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.