From 19e2773ff59a12b89593ea56f1d6462c97a8db22 Mon Sep 17 00:00:00 2001 From: Lukas Weiss Date: Tue, 18 Jun 2024 08:47:33 +0200 Subject: [PATCH] force self-closing of components and html tags without children --- ts-react.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ts-react.js b/ts-react.js index e839b70..83de8a4 100644 --- a/ts-react.js +++ b/ts-react.js @@ -24,6 +24,13 @@ module.exports = { 'error', { props: 'never', children: 'never', propElementValues: 'always' } ], + 'react/self-closing-comp': [ + 'error', + { + component: true, + html: true, + }, + ], 'react-hooks/rules-of-hooks': 'error', 'react-hooks/exhaustive-deps': 'error', 'tailwindcss/classnames-order': 'off',