Skip to content

Commit

Permalink
fixup: Update tools/eslint-rules/prefer-proto.js
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
ljharb and aduh95 authored Jan 3, 2023
1 parent b37bda2 commit b27d441
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/eslint-rules/prefer-proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ module.exports = {
},
create(context) {
return {
/* eslint max-len: 0 */
'CallExpression[callee.type="Identifier"][callee.name="ObjectCreate"][arguments.0.type="Literal"][arguments.0.value=null][arguments.length=1],\
CallExpression[callee.type="MemberExpression"][callee.object.name="Object"][callee.property.name="create"][arguments.0.type="Literal"][arguments.0.value=null][arguments.length=1]\
'(node) {
'CallExpression[arguments.length=1][arguments.0.type="Literal"][arguments.0.value=null]:matches(\
[callee.type="Identifier"][callee.name="ObjectCreate"],\
[callee.type="MemberExpression"][callee.object.name="Object"][callee.property.name="create"]\
)'(node) {
if (node.callee.type === 'MemberExpression') {
const scope = declaredScope(context, node.callee.object);
if (scope !== 'module' && scope !== 'global') {
Expand Down

0 comments on commit b27d441

Please sign in to comment.