Last change
on this file since 529 was
505,
checked in by hendrikvanantwerpen, 11 years ago
|
Added linting of json files.
|
File size:
968 bytes
|
Line | |
---|
1 | grunt-jsonlint |
---|
2 | ============== |
---|
3 | |
---|
4 | Validate JSON files from grunt. |
---|
5 | |
---|
6 | Requires grunt 0.4 |
---|
7 | |
---|
8 | # Install |
---|
9 | |
---|
10 | npm install grunt-jsonlint --save-dev |
---|
11 | |
---|
12 | # Configure |
---|
13 | |
---|
14 | Add the following (multi-)task to your Gruntfile: |
---|
15 | |
---|
16 | jsonlint: { |
---|
17 | sample: { |
---|
18 | src: [ 'some/valid.json' ] |
---|
19 | } |
---|
20 | } |
---|
21 | |
---|
22 | Add the following to load the task into your Gruntfile: |
---|
23 | |
---|
24 | grunt.loadNpmTasks('grunt-jsonlint'); |
---|
25 | |
---|
26 | An error will be thrown if the JSON file contains syntax errors. |
---|
27 | |
---|
28 | # Roadmap |
---|
29 | |
---|
30 | The underlying jsonlint library has many features not yet exposed. |
---|
31 | Each of these would be valuable in grunt. |
---|
32 | |
---|
33 | * Schema validation |
---|
34 | * Sort file by key |
---|
35 | |
---|
36 | # Release History |
---|
37 | |
---|
38 | * 2013-02-20âââv1.0.0âââFirst official release |
---|
39 | * 2013-09-19 v1.0.1 Do not log every validated file |
---|
40 | * 2013-10-31 v1.0.2 Add output of count of successfully linted JSON file for issue |
---|
41 | * 2013-11-16 v1.0.3 Fix output of count of successfully linted JSON files. |
---|
42 | * 2013-11-18 v1.0.4 Updated for latest dependencies. |
---|
Note: See
TracBrowser
for help on using the repository browser.