Skip to content

Commit

Permalink
Docs: Fix the messageId example (fixes #9889) (#9892)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 authored and platinumazure committed Jan 25, 2018
1 parent 9cbb487 commit 084351b
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions docs/developer-guide/working-with-rules.md
Expand Up @@ -222,23 +222,26 @@ var foo = 2;
// ^ error: Avoid using variables named 'foo'

// In your tests:
var rule = require('../../../lib/rules/no-insecure-random');
var RuleTester = require('eslint').RuleTester;
var rule = require("../../../lib/rules/my-rule");
var RuleTester = require("eslint").RuleTester;

var ruleTester = new RuleTester();
ruleTester.run('my-rule', rule, {
valid: ['bar', 'baz'],
ruleTester.run("my-rule", rule, {
valid: ["bar", "baz"],

invalid: [
{
code: 'foo',
errors: [
invalid: [
{
messageId: 'foo',
code: "foo",
errors: [
{
messageId: "avoidName",
data: {
name: "foo"
}
}
]
}
]
}
]
]
});
{% endraw %}
```
Expand Down

0 comments on commit 084351b

Please sign in to comment.