diff --git a/packages/eslint-config-airbnb-base/rules/best-practices.js b/packages/eslint-config-airbnb-base/rules/best-practices.js index b91133de0a..31f74b51c0 100644 --- a/packages/eslint-config-airbnb-base/rules/best-practices.js +++ b/packages/eslint-config-airbnb-base/rules/best-practices.js @@ -376,6 +376,11 @@ module.exports = { // https://eslint.org/docs/rules/prefer-named-capture-group 'prefer-named-capture-group': 'off', + // Prefer Object.hasOwn() over Object.prototype.hasOwnProperty.call() + // https://eslint.org/docs/rules/prefer-object-has-own + // TODO: semver-major: enable thus rule, once eslint v8.5.0 is required + 'prefer-object-has-own': 'off', + // https://eslint.org/docs/rules/prefer-regex-literals 'prefer-regex-literals': ['error', { disallowRedundantWrapping: true, diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json index 46fd4b6bbf..d882d4cb4f 100644 --- a/packages/eslint-config-airbnb/package.json +++ b/packages/eslint-config-airbnb/package.json @@ -79,7 +79,7 @@ "eslint-find-rules": "^4.0.0", "eslint-plugin-import": "^2.25.3", "eslint-plugin-jsx-a11y": "^6.5.1", - "eslint-plugin-react": "^7.27.1", + "eslint-plugin-react": "^7.28.0", "eslint-plugin-react-hooks": "^4.3.0", "in-publish": "^2.0.1", "react": ">= 0.13.0", @@ -90,7 +90,7 @@ "eslint": "^7.32.0 || ^8.2.0", "eslint-plugin-import": "^2.25.3", "eslint-plugin-jsx-a11y": "^6.5.1", - "eslint-plugin-react": "^7.27.1", + "eslint-plugin-react": "^7.28.0", "eslint-plugin-react-hooks": "^4.3.0" }, "engines": { diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js index 71230fac71..4ece5a342c 100644 --- a/packages/eslint-config-airbnb/rules/react.js +++ b/packages/eslint-config-airbnb/rules/react.js @@ -524,9 +524,8 @@ module.exports = { // Enforce a specific function type for function components // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md - // TODO: investigate if setting namedComponents to expression vs declaration is problematic 'react/function-component-definition': ['error', { - namedComponents: 'function-expression', + namedComponents: ['function-declaration', 'function-expression'], unnamedComponents: 'function-expression', }],