---
title: prefer-reflect
-layout: doc
rule_type: suggestion
related_rules:
- no-useless-call
This rule was **deprecated** in ESLint v3.9.0 and will not be replaced. The original intent of this rule now seems misguided as we have come to understand that `Reflect` methods are not actually intended to replace the `Object` counterparts the rule suggests, but rather exist as low-level primitives to be used with proxies in order to replicate the default behavior of various previously existing functionality.
+**Please note**: This rule contains an incorrect behavior - it will suggest you to use `Reflect.getOwnPropertyNames` rather than `Object.getOwnPropertyNames`, but the former one doesn't exist in the [specification](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflection). We suggest using the `exceptions` option with `"getOwnPropertyNames"` to avoid this false suggestion.
+
The ES6 Reflect API comes with a handful of methods which somewhat deprecate methods on old constructors:
* [`Reflect.apply`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.apply) effectively deprecates [`Function.prototype.apply`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-function.prototype.apply) and [`Function.prototype.call`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-function.prototype.call)
:::
-### Reflect.getOwnPropertyNames
-
-Deprecates `Object.getOwnPropertyNames()`
-
-Examples of **incorrect** code for this rule when used without exceptions:
-
-::: incorrect
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Object.getOwnPropertyNames({})
-```
-
-:::
-
-Examples of **correct** code for this rule when used without exceptions:
-
-::: correct
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Reflect.getOwnPropertyNames({})
-```
-
-:::
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["getOwnPropertyNames"] }` option:
-
-::: correct
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["getOwnPropertyNames"] }]*/
-
-Object.getOwnPropertyNames({})
-Reflect.getOwnPropertyNames({})
-```
-
-:::
-
### Reflect.preventExtensions
Deprecates `Object.preventExtensions()`