@@ -170,32 +170,32 @@ module.exports = {
170170 message : '__defineSetter__ is deprecated.' ,
171171 } ,
172172 ] ,
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.
175175 'no-restricted-syntax' : [
176176 'error' ,
177177 {
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']" ,
179179 message : 'Do not use a literal for the third argument of assert.deepStrictEqual()' ,
180180 } ,
181181 {
182- selector : "CallExpression[callee.object.name='assert'][callee. property.name='doesNotThrow']" ,
182+ selector : "CallExpression[callee.property.name='doesNotThrow']" ,
183183 message : 'Please replace `assert.doesNotThrow()` and add a comment next to the code instead.' ,
184184 } ,
185185 {
186- selector : "CallExpression[callee.object.name='assert'][callee. property.name='rejects'][arguments.length<2]" ,
186+ selector : "CallExpression[callee.property.name='rejects'][arguments.length<2]" ,
187187 message : '`assert.rejects()` must be invoked with at least two arguments.' ,
188188 } ,
189189 {
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']" ,
191191 message : 'Do not use a literal for the third argument of assert.strictEqual()' ,
192192 } ,
193193 {
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])" ,
195195 message : 'Use an object as second argument of `assert.throws()`.' ,
196196 } ,
197197 {
198- selector : "CallExpression[callee.object.name='assert'][callee. property.name='throws'][arguments.length<2]" ,
198+ selector : "CallExpression[callee.property.name='throws'][arguments.length<2]" ,
199199 message : '`assert.throws()` must be invoked with at least two arguments.' ,
200200 } ,
201201 {
@@ -210,6 +210,38 @@ module.exports = {
210210 selector : 'ThrowStatement > CallExpression[callee.name=/Error$/]' ,
211211 message : 'Use `new` keyword when throwing an `Error`.' ,
212212 } ,
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+ }
213245 ] ,
214246 /* eslint-enable max-len */
215247 'no-return-await' : 'error' ,
0 commit comments