Grunt task for stylish linter
Grunt Plugin for JavaScript Standard Style Linting and Formatting
Dependencies up-to-date!
The following shell commands will install grunt-standard
to your project’s package.json
in devDependencies
.
npm install grunt-standard --save-dev
yarn add grunt-standard --dev
grunt
in your project’s package.json
‘s devDependencies
.Gruntfile.js
.node >= 4
.
grunt.loadNpmTasks('grunt-standard')
node < 4
use 2.15.0
In your project’s Gruntfile.js
, add a section named standard
to the data object passed into grunt.initConfig()
.
In this example, the default options are used to lint the specified *.js
files in the root, lib/
, and tasks/
directories:
grunt.initConfig({
standard: {
app: {
src: [
'{,lib/,tasks/}*.js'
]
}
}
})
Array
[]
String
''
Boolean
false
Array
[]
Array
[]
Array
[]
Array
''
In this example, the fix
option is set to true
so the source files will be auto-formatted (and written back to disk) before being linted:
grunt.initConfig({
standard: {
options: {
fix: true
},
app: {
src: [
'{,lib/,tasks/}*.js'
]
}
}
})