diff --git a/src/rules/noUseExtendNative.ts b/src/rules/noUseExtendNative.ts index 624a17c..6e70afb 100644 --- a/src/rules/noUseExtendNative.ts +++ b/src/rules/noUseExtendNative.ts @@ -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 * diff --git a/tests/rules/noUseExtendNative.ts b/tests/rules/noUseExtendNative.ts index 2aa9eee..bbaa47e 100644 --- a/tests/rules/noUseExtendNative.ts +++ b/tests/rules/noUseExtendNative.ts @@ -5,6 +5,7 @@ const valid = [ 'error.plugin', 'error.plugn()', 'array.custom', + 'Object.groupBy()', 'Object.assign()', 'Object.keys', 'Object.keys()',