Skip to content

Commit da7c5bb

Browse files
committed
minor tweaks
1 parent 0d3445c commit da7c5bb

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,19 @@ module.exports = function (options) {
5252
try {
5353
var errors = checker.checkString(file.contents.toString(), file.relative);
5454
var errorList = errors.getErrorList();
55-
file.jscs = {success: true, errorCount: 0, errors: []};
55+
56+
file.jscs = {
57+
success: true,
58+
errorCount: 0,
59+
errors: []
60+
};
61+
5662
if (errorList.length > 0) {
5763
file.jscs.success = false;
5864
file.jscs.errorCount = errorList.length;
5965
file.jscs.errors = errorList;
6066
}
67+
6168
errorList.forEach(function (err) {
6269
out.push(errors.explainError(err, true));
6370
});

readme.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,20 @@ gulp.task('default', function () {
3232
A `jscs` object will be attached to the file object which can be used for custom error reporting. An example with one error might look like this:
3333

3434
```js
35-
{ success: false, // or true if no errors
36-
errorCount: 1, // number of errors in the errors array
37-
errors: [ // an array of jscs error objects
38-
{ filename: 'index.js', // basename of the file
39-
rule: 'requireCamelCaseOrUpperCaseIdentifiers', // jscs rule which triggered the error
40-
message: 'All identifiers must be camelCase or UPPER_CASE', // error message returned by the rule
41-
line: 32, // error line number
42-
column: 7 } // error column
43-
]};
35+
{
36+
success: false, // or true if no errors
37+
errorCount: 1, // number of errors in the errors array
38+
errors: [{ // an array of jscs error objects
39+
filename: 'index.js', // basename of the file
40+
rule: 'requireCamelCaseOrUpperCaseIdentifiers', // the rule which triggered the error
41+
message: 'All identifiers must be camelCase or UPPER_CASE', // error message
42+
line: 32, // error line number
43+
column: 7 // error column
44+
}]
45+
};
4446
```
4547

48+
4649
## API
4750

4851
### jscs(options)

0 commit comments

Comments
 (0)