@@ -170,32 +170,32 @@ module.exports = {
170
170
message : '__defineSetter__ is deprecated.' ,
171
171
} ,
172
172
] ,
173
- // If this list is modified, please copy the change to lib/.eslintrc.yaml
174
- // and test /.eslintrc.yaml.
173
+ // If this list is modified, please copy changes that should apply to ./lib
174
+ // as well to lib /.eslintrc.yaml.
175
175
'no-restricted-syntax' : [
176
176
'error' ,
177
177
{
178
- selector : "CallExpression[callee.object.name='assert'][callee. property.name='deepStrictEqual'][arguments.2.type='Literal']" ,
178
+ selector : "CallExpression[callee.property.name='deepStrictEqual'][arguments.2.type='Literal']" ,
179
179
message : 'Do not use a literal for the third argument of assert.deepStrictEqual()' ,
180
180
} ,
181
181
{
182
- selector : "CallExpression[callee.object.name='assert'][callee. property.name='doesNotThrow']" ,
182
+ selector : "CallExpression[callee.property.name='doesNotThrow']" ,
183
183
message : 'Please replace `assert.doesNotThrow()` and add a comment next to the code instead.' ,
184
184
} ,
185
185
{
186
- selector : "CallExpression[callee.object.name='assert'][callee. property.name='rejects'][arguments.length<2]" ,
186
+ selector : "CallExpression[callee.property.name='rejects'][arguments.length<2]" ,
187
187
message : '`assert.rejects()` must be invoked with at least two arguments.' ,
188
188
} ,
189
189
{
190
- selector : "CallExpression[callee.object.name='assert'][callee. property.name='strictEqual'][arguments.2.type='Literal']" ,
190
+ selector : "CallExpression[callee.property.name='strictEqual'][arguments.2.type='Literal']" ,
191
191
message : 'Do not use a literal for the third argument of assert.strictEqual()' ,
192
192
} ,
193
193
{
194
- selector : "CallExpression[callee.object.name='assert'][callee. property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])" ,
194
+ selector : "CallExpression[callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])" ,
195
195
message : 'Use an object as second argument of `assert.throws()`.' ,
196
196
} ,
197
197
{
198
- selector : "CallExpression[callee.object.name='assert'][callee. property.name='throws'][arguments.length<2]" ,
198
+ selector : "CallExpression[callee.property.name='throws'][arguments.length<2]" ,
199
199
message : '`assert.throws()` must be invoked with at least two arguments.' ,
200
200
} ,
201
201
{
@@ -210,6 +210,38 @@ module.exports = {
210
210
selector : 'ThrowStatement > CallExpression[callee.name=/Error$/]' ,
211
211
message : 'Use `new` keyword when throwing an `Error`.' ,
212
212
} ,
213
+ {
214
+ selector : "CallExpression[callee.property.name='notDeepStrictEqual'][arguments.length<2]" ,
215
+ message : 'assert.notDeepStrictEqual() must be invoked with at least two arguments.' ,
216
+ } ,
217
+ {
218
+ selector : "CallExpression[callee.property.name='deepStrictEqual'][arguments.length<2]" ,
219
+ message : 'assert.deepStrictEqual() must be invoked with at least two arguments.' ,
220
+ } ,
221
+ {
222
+ selector : "CallExpression[callee.property.name='notStrictEqual'][arguments.length<2]" ,
223
+ message : 'assert.notStrictEqual() must be invoked with at least two arguments.' ,
224
+ } ,
225
+ {
226
+ selector : "CallExpression[callee.property.name='strictEqual'][arguments.length<2]" ,
227
+ message : 'assert.strictEqual() must be invoked with at least two arguments.' ,
228
+ } ,
229
+ {
230
+ selector : "CallExpression[callee.property.name='notDeepStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])" ,
231
+ message : 'The first argument should be the `actual`, not the `expected` value.' ,
232
+ } ,
233
+ {
234
+ selector : "CallExpression[callee.property.name='notStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])" ,
235
+ message : 'The first argument should be the `actual`, not the `expected` value.' ,
236
+ } ,
237
+ {
238
+ selector : "CallExpression[callee.property.name='deepStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])" ,
239
+ message : 'The first argument should be the `actual`, not the `expected` value.' ,
240
+ } ,
241
+ {
242
+ selector : "CallExpression[callee.property.name='strictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])" ,
243
+ message : 'The first argument should be the `actual`, not the `expected` value.' ,
244
+ }
213
245
] ,
214
246
/* eslint-enable max-len */
215
247
'no-return-await' : 'error' ,
0 commit comments