Skip to content

Commit

Permalink
Docs: Include note on fatal: true in the node.js api section (#7376)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored and platinumazure committed Oct 19, 2016
1 parent e064a25 commit 2aa1107
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion docs/developer-guide/nodejs-api.md
Expand Up @@ -224,7 +224,6 @@ The return value is an object containing the results of the linting operation. H
output: "foo;",
messages: [
{
fatal: false,
severity: 2,
ruleId: "semi",
severity: 2,
Expand All @@ -242,6 +241,34 @@ The return value is an object containing the results of the linting operation. H
}
```

If the operation ends with a parsing error, you will get a single message for this file, with `fatal: true` added as an extra property.

```js
{
results: [
{
filePath: "./myfile.js",
messages: [
{
ruleId: null,
fatal: true,
severity: 2,
source: "fucntion foo() {}",
message: "Parsing error: Unexpected token foo",
line: 1,
column: 10
}
],
errorCount: 1,
warningCount: 0,
source: "fucntion foo() {}"
}
],
errorCount: 1,
warningCount: 0
}
```

The top-level report object has a `results` array containing all linting results for files that had warnings or errors (any files that did not produce a warning or error are omitted). Each file result includes:

* `filePath` - Path to the given file.
Expand Down

0 comments on commit 2aa1107

Please sign in to comment.