@4cm4k1/grunt-standard

3.0.1 • Public • Published

grunt-standard JavaScript Standard Style

Grunt Plugin for JavaScript Standard Style Linting and Formatting

Based on @pdehaan/grunt-standard

Dependencies up-to-date!

Install

The following shell commands will install grunt-standard to your project's package.json in devDependencies.

npm

npm install @4cm4k1/grunt-standard --save-dev

Yarn

yarn add @4cm4k1/grunt-standard --dev

Assumptions

  • You have the latest version of grunt in your project's package.json's devDependencies.
  • You have added the npm task to your project's Gruntfile.js.
  • You are running the latest version of node.
grunt.loadNpmTasks('grunt-standard')

Configure

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

Default

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'
      ]
    }
  }
})

Custom

options.format

  • Type: Boolean
  • Default: false
  • Action: Auto-format source files using standard-format.

options.lint

In this example, the format 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: {
      format: true
    },
    app: {
      src: [
        '{,lib/,tasks/}*.js'
      ]
    }
  }
})

Contribute

Readme

Keywords

none

Package Sidebar

Install

npm i @4cm4k1/grunt-standard

Weekly Downloads

2

Version

3.0.1

License

MIT

Last publish

Collaborators

  • 4cm4k1