https://github.com/james2doyle/grunt-jsfmt
a grunt task for the jsfmt tool
https://github.com/james2doyle/grunt-jsfmt
Last synced: about 1 year ago
JSON representation
a grunt task for the jsfmt tool
- Host: GitHub
- URL: https://github.com/james2doyle/grunt-jsfmt
- Owner: james2doyle
- License: mit
- Created: 2014-05-11T16:48:52.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-09T13:24:46.000Z (almost 12 years ago)
- Last Synced: 2025-04-02T22:33:06.211Z (about 1 year ago)
- Language: JavaScript
- Size: 200 KB
- Stars: 14
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grunt-jsfmt
> a task for the [jsfmt](https://github.com/rdio/jsfmt) library
## Getting Started
This plugin requires Grunt.
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
```shell
npm install grunt-jsfmt --save-dev
```
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
```js
grunt.loadNpmTasks('grunt-jsfmt');
```
## The "jsfmt" task
### Usage
In your project's Gruntfile, add a section named `jsfmt` to the data object passed into `grunt.initConfig()`.
```js
grunt.initConfig({
jsfmt: {
default: {
options: {
rewrite: ['_.reduce(a, b, c) -> a.reduce(b, c)']
},
files: [{
expand: true,
src: ['**/*.js'],
cwd: 'src/',
dest: 'src/'
}]
}
}
})
```
### Options
#### options.rewrite
Type: `Array`
Default value: `'[]'`
An array of values that you want to rewrite.
## Contributing
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](http://gruntjs.com/).
## License
Copyright (c) 2014 james2doyle (James Doyle). Licensed under the MIT license.