Skip to content

Commit a0b11ca

Browse files
authored
feat(eslint-config): enable prefer-object-has-own (#564)
* feat(eslint-config): enable prefer-object-has-own * fix: enable rule
1 parent a2e30e5 commit a0b11ca

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

packages/eslint-config-react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"dependencies": {
2020
"@typescript-eslint/eslint-plugin": "5.8.1",
2121
"@typescript-eslint/parser": "5.8.1",
22-
"eslint-config-airbnb": "19.0.2",
22+
"eslint-config-airbnb": "19.0.4",
2323
"eslint-config-airbnb-typescript": "16.1.0",
2424
"eslint-config-prettier": "8.3.0",
2525
"eslint-plugin-eslint-comments": "3.2.0",
@@ -29,6 +29,6 @@
2929
"eslint-plugin-react-hooks": "4.3.0"
3030
},
3131
"peerDependencies": {
32-
"eslint": "7.x || 8.x"
32+
"eslint": ">= 8.5"
3333
}
3434
}

packages/eslint-config-react/shared.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable sort-keys */
2+
13
module.exports = {
24
extends: ['airbnb/hooks', 'prettier', 'plugin:eslint-comments/recommended'],
35
rules: {
@@ -57,6 +59,7 @@ module.exports = {
5759
// These are rules soon to be enabled by airbnb react config
5860
// We're getting a head start
5961
'react/no-adjacent-inline-elements': 'error', // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md
62+
'prefer-object-has-own': 'error', // https://eslint.org/docs/rules/prefer-object-has-own
6063

6164
// To have consistent ordering in proptypes
6265
'react/sort-prop-types': [
@@ -76,3 +79,5 @@ module.exports = {
7679
'sort-keys': ['error', 'asc', { caseSensitive: false, natural: true }],
7780
},
7881
}
82+
83+
/* eslint-enable sort-keys */

yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3151,7 +3151,7 @@ __metadata:
31513151
dependencies:
31523152
"@typescript-eslint/eslint-plugin": 5.8.1
31533153
"@typescript-eslint/parser": 5.8.1
3154-
eslint-config-airbnb: 19.0.2
3154+
eslint-config-airbnb: 19.0.4
31553155
eslint-config-airbnb-typescript: 16.1.0
31563156
eslint-config-prettier: 8.3.0
31573157
eslint-plugin-eslint-comments: 3.2.0
@@ -3160,7 +3160,7 @@ __metadata:
31603160
eslint-plugin-react: 7.28.0
31613161
eslint-plugin-react-hooks: 4.3.0
31623162
peerDependencies:
3163-
eslint: 7.x || 8.x
3163+
eslint: ">= 8.5"
31643164
languageName: unknown
31653165
linkType: soft
31663166

@@ -5493,9 +5493,9 @@ __metadata:
54935493
languageName: node
54945494
linkType: hard
54955495

5496-
"eslint-config-airbnb@npm:19.0.2":
5497-
version: 19.0.2
5498-
resolution: "eslint-config-airbnb@npm:19.0.2"
5496+
"eslint-config-airbnb@npm:19.0.4":
5497+
version: 19.0.4
5498+
resolution: "eslint-config-airbnb@npm:19.0.4"
54995499
dependencies:
55005500
eslint-config-airbnb-base: ^15.0.0
55015501
object.assign: ^4.1.2
@@ -5504,9 +5504,9 @@ __metadata:
55045504
eslint: ^7.32.0 || ^8.2.0
55055505
eslint-plugin-import: ^2.25.3
55065506
eslint-plugin-jsx-a11y: ^6.5.1
5507-
eslint-plugin-react: ^7.27.1
5507+
eslint-plugin-react: ^7.28.0
55085508
eslint-plugin-react-hooks: ^4.3.0
5509-
checksum: 668d91fee4d8e1b7ecefc3844caed6bb77a72b29521dd9595a14abaebb8651439b831da792614b51e7913bbe3b6d20df03e76f52287ccf511dee1982460d3f71
5509+
checksum: 253178689c3c80eef2567e3aaf0612e18973bc9cf51d9be36074b5dd58210e8b6942200a424bcccbb81ac884e41303479ab09f251a2a97addc2de61efdc9576c
55105510
languageName: node
55115511
linkType: hard
55125512

0 commit comments

Comments
 (0)