Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teppeis/grunt-fixclosure
Grunt plugin for fixclosure
https://github.com/teppeis/grunt-fixclosure
closure-library grunt linter
Last synced: about 2 months ago
JSON representation
Grunt plugin for fixclosure
- Host: GitHub
- URL: https://github.com/teppeis/grunt-fixclosure
- Owner: teppeis
- Created: 2013-11-15T07:01:53.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2023-01-09T01:58:29.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T17:00:42.370Z (6 months ago)
- Topics: closure-library, grunt, linter
- Language: JavaScript
- Homepage: https://npm.im/grunt-fixclosure
- Size: 384 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# grunt-fixclosure
Grunt plugin for [fixclosure](https://github.com/teppeis/fixclosure).
[![NPM version][npm-image]][npm-url]
![Node.js version support][node-version]
[![Build Status][ci-image]][ci-url]
![MIT License][license]## Getting Started
This plugin requires Grunt `>=0.4.0`
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 -D grunt-fixclosure fixclosure
```Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
```js
grunt.loadNpmTasks("grunt-fixclosure");
```## The "fixclosure" task
### Overview
In your project's Gruntfile, add a section named `fixclosure` to the data object passed into `grunt.initConfig()`.
```js
grunt.initConfig({
fixclosure: {
options: {
fixInPlace: true,
},
all: {
src: ["path/to/**/*.js"],
},
},
});
```### Options
#### options.fixInPlace
Type: `Boolean`
Default value: `false`Enable `--fix-in-place` option of fixclosure.
If true, fixclosure fixes invalid files in place.### Usage Examples
#### Lint
By default, grunt-fixclosure just lint JS files. If invalid files found, `grunt fixclosrue` exits with non-zero error code. It's useful for CI task.
```js
grunt.initConfig({
fixclosure: {
lint: {
src: ["path/to/**/*.js"],
},
},
});
```#### Fix
With `fixInPlace` option, `grunt fixclosure` finds invalid files and fixes them.
```js
grunt.initConfig({
fixclosure: {
fix: {
fixInPlace: true,
src: ["path/to/**/*.js"],
},
},
});
```Also you can specify it with command-line option `--fixclosure-fix-in-place`.
```bash
$ grunt fixclosure --fixclosure-fix-in-place
```## Release History
- v2+: See [GitHub releases](https://github.com/teppeis/grunt-fixclosure/releases)
- 2016-04-06 [v1.0.0](https://github.com/teppeis/grunt-fixclosure/releases/tag/1.0.0) Update grunt to v1.0 and other deps.
- 2016-03-16 [v0.3.1](https://github.com/teppeis/grunt-fixclosure/releases/tag/0.3.1) Cleanup, fix `main` in package.json and support for [email protected] [#11](https://github.com/teppeis/grunt-fixclosure/pull/11)
- 2014-06-12 [v0.3.0](https://github.com/teppeis/grunt-fixclosure/releases/tag/0.3.0) Update fixclosure-1.3.0 and use caret `^1.3.0` instead of tilde `~1.3.0`.
- 2014-05-02 [v0.2.0](https://github.com/teppeis/grunt-fixclosure/releases/tag/0.2.0) Update fixclosure-1.2.0.
- 2014-04-28 [v0.1.0](https://github.com/teppeis/grunt-fixclosure/releases/tag/0.1.0) Update fixclosure-1.1.0.
- 2014-02-17 [v0.0.1](https://github.com/teppeis/grunt-fixclosure/releases/tag/0.0.1) Initial release with [fixclosure 1.0.0](https://github.com/teppeis/fixclosure/releases/tag/1.0.0) !## License
Copyright (c) 2016 Teppei Sato <[email protected]>. Licensed under the MIT license.
[npm-image]: https://badgen.net/npm/v/grunt-fixclosure?icon=npm&label=
[npm-url]: https://npmjs.org/package/grunt-fixclosure
[ci-image]: https://github.com/teppeis/grunt-fixclosure/workflows/ci/badge.svg
[ci-url]: https://github.com/teppeis/grunt-fixclosure/actions?query=workflow%3A%22ci%22
[deps-image]: https://badgen.net/david/dep/teppeis/grunt-fixclosure
[deps-url]: https://david-dm.org/teppeis/grunt-fixclosure
[node-version]: https://badgen.net/npm/node/grunt-fixclosure
[license]: https://badgen.net/npm/license/grunt-fixclosure