Skip to content

Commit

Permalink
Deprecate prefer-object-has-own (#1646)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Dec 20, 2021
1 parent 64460e2 commit e59a856
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 380 deletions.
2 changes: 0 additions & 2 deletions configs/recommended.js
Expand Up @@ -76,8 +76,6 @@ module.exports = {
'unicorn/prefer-node-protocol': 'error',
'unicorn/prefer-number-properties': 'error',
'unicorn/prefer-object-from-entries': 'error',
// TODO: Enable this by default when targeting Node.js 16.
'unicorn/prefer-object-has-own': 'off',
'unicorn/prefer-optional-catch-binding': 'error',
'unicorn/prefer-prototype-methods': 'error',
'unicorn/prefer-query-selector': 'error',
Expand Down
4 changes: 4 additions & 0 deletions docs/deprecated-rules.md
Expand Up @@ -36,6 +36,10 @@ This rule was renamed to [`prefer-dom-node-append`](rules/prefer-dom-node-append

This rule was renamed to [`prefer-dom-node-remove`](rules/prefer-dom-node-remove.md) to be less ambiguous.

## prefer-object-has-own

This rule was deprecated in favor of the built-in ESLint [`prefer-object-has-own`](https://eslint.org/docs/rules/prefer-object-has-own) rule.

## prefer-replace-all

This rule was renamed to [`prefer-string-replace-all`](rules/prefer-string-replace-all.md) to be more specific.
Expand Down
58 changes: 0 additions & 58 deletions docs/rules/prefer-object-has-own.md

This file was deleted.

1 change: 1 addition & 0 deletions index.js
Expand Up @@ -15,6 +15,7 @@ const deprecatedRules = createDeprecatedRules({
'prefer-flat-map': 'unicorn/prefer-array-flat-map',
'prefer-node-append': 'unicorn/prefer-dom-node-append',
'prefer-node-remove': 'unicorn/prefer-dom-node-remove',
'prefer-object-has-own': 'prefer-object-has-own',
'prefer-replace-all': 'unicorn/prefer-string-replace-all',
'prefer-starts-ends-with': 'unicorn/prefer-string-starts-ends-with',
'prefer-text-content': 'unicorn/prefer-dom-node-text-content',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -71,7 +71,7 @@
"ava": "^3.15.0",
"chalk": "^5.0.0",
"enquirer": "^2.3.6",
"eslint": "^8.4.1",
"eslint": "^8.5.0",
"eslint-ava-rule-tester": "^4.0.0",
"eslint-plugin-eslint-plugin": "^4.1.0",
"eslint-remote-tester": "^2.0.1",
Expand Down
2 changes: 0 additions & 2 deletions readme.md
Expand Up @@ -109,7 +109,6 @@ Configure it in `package.json`.
"unicorn/prefer-node-protocol": "error",
"unicorn/prefer-number-properties": "error",
"unicorn/prefer-object-from-entries": "error",
"unicorn/prefer-object-has-own": "off",
"unicorn/prefer-optional-catch-binding": "error",
"unicorn/prefer-prototype-methods": "error",
"unicorn/prefer-query-selector": "error",
Expand Down Expand Up @@ -223,7 +222,6 @@ Each rule has emojis denoting:
| [prefer-node-protocol](docs/rules/prefer-node-protocol.md) | Prefer using the `node:` protocol when importing Node.js builtin modules. || 🔧 | |
| [prefer-number-properties](docs/rules/prefer-number-properties.md) | Prefer `Number` static properties over global ones. || 🔧 | 💡 |
| [prefer-object-from-entries](docs/rules/prefer-object-from-entries.md) | Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object. || 🔧 | |
| [prefer-object-has-own](docs/rules/prefer-object-has-own.md) | Prefer `Object.hasOwn(…)` over `Object.prototype.hasOwnProperty.call(…)`. | | 🔧 | |
| [prefer-optional-catch-binding](docs/rules/prefer-optional-catch-binding.md) | Prefer omitting the `catch` binding parameter. || 🔧 | |
| [prefer-prototype-methods](docs/rules/prefer-prototype-methods.md) | Prefer borrowing methods from the prototype instead of the instance. || 🔧 | |
| [prefer-query-selector](docs/rules/prefer-query-selector.md) | Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()`. || 🔧 | |
Expand Down
106 changes: 0 additions & 106 deletions rules/prefer-object-has-own.js

This file was deleted.

94 changes: 0 additions & 94 deletions test/prefer-object-has-own.mjs

This file was deleted.

0 comments on commit e59a856

Please sign in to comment.