From 89f2925cdcf581ccead003d2d8133ec208fe35fd Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Fri, 12 Jul 2024 12:24:14 +0200 Subject: [PATCH] feat: Don't require default props for function components --- .eslintrc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 14967891..d691689a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -65,5 +65,12 @@ module.exports = { 'react/destructuring-assignment': 'off', 'no-plusplus': 'off', strict: 'off', + // We don't require 'defaultProps' for function components (they're + // deprecated: https://github.com/facebook/react/pull/16210). + // It's better to use native JavaScript/TypeScript defaults and TS types. + 'react/require-default-props': ['error', { + classes: 'defaultProps', + functions: 'ignore', + }], }, };