File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,16 @@ const create = context => {
1717 const { callee} = node ;
1818 const { name} = callee ;
1919
20+ if (
21+ name === 'Object' &&
22+ node . parent &&
23+ node . parent . type === 'BinaryExpression' &&
24+ ( node . parent . operator === '===' || node . parent . operator === '!==' ) &&
25+ ( node . parent . left === node || node . parent . right === node )
26+ ) {
27+ return ;
28+ }
29+
2030 if ( enforceNew . has ( name ) && ! isShadowed ( context . getScope ( ) , callee ) ) {
2131 context . report ( {
2232 node,
Original file line number Diff line number Diff line change @@ -108,7 +108,10 @@ test({
108108 ` ,
109109 // Not builtin
110110 'new Foo();Bar();' ,
111- 'Foo();new Bar();'
111+ 'Foo();new Bar();' ,
112+ // Ignored
113+ 'const isObject = v => Object(v) === v;' ,
114+ '(x) !== Object(x)'
112115 ] ,
113116 invalid : [
114117 {
You can’t perform that action at this time.
0 commit comments