@@ -112,15 +112,24 @@ var emitter = new events();
112
112
113
113
### newIsCapExceptionPattern
114
114
115
- Examples of additional ** correct** code for this rule with the ` { "newIsCapExceptionPattern": "^person\.." } ` option:
115
+ Examples of additional ** correct** code for this rule with the ` { "newIsCapExceptionPattern": "^person\\ .." } ` option:
116
116
117
117
``` js
118
- /* eslint new-cap: ["error", { "newIsCapExceptionPattern": "^person\.." }]*/
118
+ /* eslint new-cap: ["error", { "newIsCapExceptionPattern": "^person\\ .." }]*/
119
119
120
120
var friend = new person.acquaintance ();
121
+
121
122
var bestFriend = new person.friend ();
122
123
```
123
124
125
+ Examples of additional ** correct** code for this rule with the ` { "newIsCapExceptionPattern": "\\.bar$" } ` option:
126
+
127
+ ``` js
128
+ /* eslint new-cap: ["error", { "newIsCapExceptionPattern": "\\.bar$" }]*/
129
+
130
+ var friend = new person.bar ();
131
+ ```
132
+
124
133
### capIsNewExceptions
125
134
126
135
Examples of additional ** correct** code for this rule with the ` { "capIsNewExceptions": ["Person"] } ` option:
@@ -135,15 +144,35 @@ function foo(arg) {
135
144
136
145
### capIsNewExceptionPattern
137
146
138
- Examples of additional ** correct** code for this rule with the ` { "capIsNewExceptionPattern": "^Person \.." } ` option:
147
+ Examples of additional ** correct** code for this rule with the ` { "capIsNewExceptionPattern": "^person\ \.." } ` option:
139
148
140
149
``` js
141
- /* eslint new-cap: ["error", { "capIsNewExceptionPattern": "^Person \.." }]*/
150
+ /* eslint new-cap: ["error", { "capIsNewExceptionPattern": "^person\ \.." }]*/
142
151
143
152
var friend = person .Acquaintance ();
144
153
var bestFriend = person .Friend ();
145
154
```
146
155
156
+ Examples of additional ** correct** code for this rule with the ` { "capIsNewExceptionPattern": "\\.Bar$" } ` option:
157
+
158
+ ``` js
159
+ /* eslint new-cap: ["error", { "capIsNewExceptionPattern": "\\.Bar$" }]*/
160
+
161
+ foo .Bar ();
162
+ ```
163
+
164
+ Examples of additional ** correct** code for this rule with the ` { "capIsNewExceptionPattern": "^Foo" } ` option:
165
+
166
+ ``` js
167
+ /* eslint new-cap: ["error", { "capIsNewExceptionPattern": "^Foo" }]*/
168
+
169
+ var x = Foo (42 );
170
+
171
+ var y = Foobar (42 );
172
+
173
+ var z = Foo .Bar (42 );
174
+ ```
175
+
147
176
### properties
148
177
149
178
Examples of ** incorrect** code for this rule with the default ` { "properties": true } ` option:
0 commit comments