grunt-jssemicoloned

0.0.6 • Public • Published

grunt-jssemicoloned

This is a Grunt task to validate JavaScript source. It uses Acorn to look for possible syntax errors and automatically inserts missing semicolons.

How to Use It

First, install the package:

npm install grunt-jssemicoloned

Modify your Gruntfile.js file to have the following line somewhere:

grunt.loadNpmTasks('grunt-jssemicoloned');

If it has been installed correctly, running grunt --help should include jssemicoloned in the list of available tasks.

Set the files to be validated, as part of Grunt configuration via the new jssemicoloned key. As an example, initConfig in your grunt.js might look like the following fragment:

grunt.initConfig({
  pkg: '<json:package.json>',
  jssemicoloned: {
    files: ['*.js', 'lib/**/*.js', 'test/**/*.js']
  },
  test: {
    files: ['test/**/*.js']
  }
}

You can specify the files to be validated using the usual file pattern. In the above examples, it will validate every *.js files in the main directory, the lib directory, and the test directory. It will also alter all files with missing semicolons.

Whenever you want the semicolon insertion task to run, just invoke it using:

grunt jssemicoloned

It is not recommended to include the validation task in your default.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.6
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.6
    1
  • 0.0.4
    0
  • 0.0.1
    0
  • 0.0.0
    0

Package Sidebar

Install

npm i grunt-jssemicoloned

Weekly Downloads

1

Version

0.0.6

License

MIT

Last publish

Collaborators

  • crydust