Skip to content

Commit

Permalink
fix: add support for groupBy
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed May 23, 2024
1 parent f8f445d commit 928a74f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rules/noUseExtendNative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@
import isGetSetProp from 'is-get-set-prop';
import isJsType from 'is-js-type';
import isObjProp from 'is-obj-prop';
import isProtoProp from 'is-proto-prop';
import isProtoPropOriginal from 'is-proto-prop';
import { createRule } from '../utilities';

const isProtoProp = (jsType: string, propertyName: string) => {
if (jsType === 'Object' && propertyName === 'groupBy') {
return true;
}

return isProtoPropOriginal(jsType, propertyName);
};

/**
* Return type of value of left or right
*
Expand Down
1 change: 1 addition & 0 deletions tests/rules/noUseExtendNative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const valid = [
'error.plugin',
'error.plugn()',
'array.custom',
'Object.groupBy()',
'Object.assign()',
'Object.keys',
'Object.keys()',
Expand Down

0 comments on commit 928a74f

Please sign in to comment.