Package Exports
- grunt-lintspaces
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (grunt-lintspaces) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
#grunt-lintspaces
A Grunt task for checking spaces in files.
Getting Started
If you haven't used grunt before, be sure to check out the Getting Started guide.
From the same directory as your project's Gruntfile and package.json, install this plugin with the following command:
npm install git://github.com/schorfES/grunt-lintspaces --save-devOnce that's done, add this line to your project's Gruntfile:
grunt.loadNpmTasks('grunt-lintspaces');Overview
Inside your grunt.js file add a section named lintspaces. This section specifies the tasks. Each task takes sources and options as parameters.
Parameters
sources src
This sets the path of the files to be checked.
options object
This controls how this task operate and should contain key:value pairs, see options below.
newline option
Tests for newlines at the end of all files. Default value is false.
newline: truetrailingspaces option
Tests for useless whitespaces (trailing whitespaces) at each lineending of all files. Default value is false.
trailingspaces: trueindentation options
Tests for correct indentation using tabs or spaces. Default value is false. To enable indentation check use the value 'tabs' or 'spaces'.
indentation: 'tabs'If the indentation option is set to 'spaces', there is also the possibility to set the amount of spaces per indentation using the spaces option. Default value is 4.
indentation: 'spaces',
spaces: 2Configuration Example
lintspaces: {
all: {
src: [
'**/*'
]
options: {
newline: true,
trailingspaces: true,
indentation: 'spaces',
spaces: 2
}
},
javascript: {
src: [
'js/src/**/*.js'
]
options: {
newline: true,
trailingspaces: true,
indentation: 'tabs'
}
}
}Tests
Run grunt to lint and run the tests.