From 163d8af72e1729c51dfe41b5d09f99b19e216758 Mon Sep 17 00:00:00 2001 From: Romain Le Quellec Date: Wed, 21 Nov 2018 09:32:29 +0100 Subject: [PATCH] Fix: switch incorrect example with correct one It looks like we always show the incorrect example first, so the fact that in this example we want to show the correct code first might be on purpose, but it does not look like it is --- docs/rules/id-match.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/rules/id-match.md b/docs/rules/id-match.md index 55f5e32539f..0d9deebd76d 100644 --- a/docs/rules/id-match.md +++ b/docs/rules/id-match.md @@ -23,20 +23,6 @@ For example, to enforce a camelcase naming convention: } ``` -Examples of **correct** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$"` option: - -```js -/*eslint id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$"]*/ - -var myFavoriteColor = "#112C85"; -var foo = bar.baz_boom; -var foo = { qux: bar.baz_boom }; -do_something(); -var obj = { - my_pref: 1 -}; -``` - Examples of **incorrect** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$"` option: ```js @@ -54,6 +40,20 @@ obj.do_something = function() { }; ``` +Examples of **correct** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$"` option: + +```js +/*eslint id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$"]*/ + +var myFavoriteColor = "#112C85"; +var foo = bar.baz_boom; +var foo = { qux: bar.baz_boom }; +do_something(); +var obj = { + my_pref: 1 +}; +``` + This rule has an object option: * `"properties": true` requires object properties to match the specified regular expression