A code analysis tool for validating components built with the Sky library.
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');
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.
},
},
});
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.
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'],
},
});
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.