From 5793301c609036b7845a909e8420e8c0e0778624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Thu, 8 Sep 2022 17:21:36 +0200 Subject: [PATCH] fix(lint): disable `react/no-unknown-property` (#40331) ~(PR https://github.com/jsx-eslint/eslint-plugin-react/pull/3377) introduced a change in `eslint-plugin-react@7.31.2` that will now show an error when unknown properties appear on elements. We can opt out of this by overriding the default.~ As discussed internally, we are turning `react/no-unknown-property` off, as it might be confusing even if different props are being used, (eg.: `css` for `emotion`). It's easy to fix https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md#rule-options, but it might not be clear at first glance that Next.js is using `eslint-plugin-react` internally. If the user wants to enforce this rule, they can still add it to their own `rules` config. Fixes #40321, ref: https://github.com/vercel/next.js/discussions/40269, https://github.com/vercel/next.js/issues/38333 --- packages/eslint-config-next/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/eslint-config-next/index.js b/packages/eslint-config-next/index.js index 5c846dee12af..24a28c0c523b 100644 --- a/packages/eslint-config-next/index.js +++ b/packages/eslint-config-next/index.js @@ -60,6 +60,7 @@ module.exports = { plugins: ['import', 'react', 'jsx-a11y'], rules: { 'import/no-anonymous-default-export': 'warn', + 'react/no-unknown-property': 'off', 'react/react-in-jsx-scope': 'off', 'react/prop-types': 'off', 'jsx-a11y/alt-text': [