A code analysis tool for validating components built with the Sky library.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
tasks
test
.brackets.json
.gitignore
.jscsrc
.jshintrc
Gruntfile.js
LICENSE-MIT
README.md
package.json

README.md

grunt-skylint

A code analysis tool for validating components built with the Sky library.

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install git+https://github.com/blackbaud/grunt-skylint --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-skylint');

The "skylint" task

Overview

In your project's Gruntfile, add a section named skylint to the data object passed into grunt.initConfig().

grunt.initConfig({
  skylint: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
});

Options

options.linterUrl

Type: String

Required. The URL to the Skylint file to use to validate your code. While the Grunt task reports on validation errors, the actual validation logic takes place in code that is bundled with the Sky distribution. This allows you to continue to upgrade Sky in your product and have the Grunt task point to the version of Sky that your product is currently on.

Usage Examples

Linting all HTML files in a directory

In this example, all files with an .html file extension in the src directory will be linted.

grunt.initConfig({
  skylint: {
    options: {
      linterUrl: 'https://sky.blackbaudcdn.net/skyux/dev/js/skylint.min.js'
    },
    files: ['src/**/*.html'],
  },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.