Skip to content

Commit cd8b386

Browse files
authored
chore(eslint): add react/self-closing-comp (#2563)
1 parent 947f70c commit cd8b386

16 files changed

Lines changed: 33 additions & 31 deletions

File tree

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ module.exports = {
4545
overrides: [
4646
{
4747
files: ['**/*.tsx'],
48+
plugins: ['react'],
4849
rules: {
4950
'react/prop-types': 'off',
51+
'react/self-closing-comp': 'error',
5052
},
5153
},
5254
],

src/components/Common/SlideCheckbox/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ const SlideCheckbox = ({ onClick, checked = false }: SlideCheckboxProps) => {
2424
className={`${
2525
checked ? 'bg-indigo-500' : 'bg-gray-700'
2626
} absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out`}
27-
></span>
27+
/>
2828
<span
2929
aria-hidden="true"
3030
className={`${
3131
checked ? 'translate-x-5' : 'translate-x-0'
3232
} absolute left-0 inline-block h-5 w-5 rounded-full border border-gray-200 bg-white shadow transition-transform duration-200 ease-in-out group-focus:border-blue-300 group-focus:ring`}
33-
></span>
33+
/>
3434
</span>
3535
);
3636
};

src/components/Discover/CreateSlider/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ const CreateSlider = ({ onCreate, slider }: CreateSliderProps) => {
508508
typeof errors.data === 'string' && (
509509
<div className="error">{errors.data}</div>
510510
)}
511-
<div className="flex-1"></div>
511+
<div className="flex-1" />
512512
{resultCount === 0 ? (
513513
<Tooltip content={intl.formatMessage(messages.needresults)}>
514514
<div>

src/components/GenreCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const GenreCardPlaceholder = () => {
5858
return (
5959
<div
6060
className={`relative h-32 w-56 animate-pulse rounded-xl bg-gray-700 sm:h-40 sm:w-72`}
61-
></div>
61+
/>
6262
);
6363
};
6464

src/components/Layout/Sidebar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const Sidebar = ({
163163
leaveTo="opacity-0"
164164
>
165165
<div className="fixed inset-0">
166-
<div className="absolute inset-0 bg-gray-900 opacity-90"></div>
166+
<div className="absolute inset-0 bg-gray-900 opacity-90" />
167167
</div>
168168
</Transition.Child>
169169
<Transition.Child

src/components/Login/JellyfinLogin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
154154
{errors.password && touched.password && (
155155
<div className="error">{errors.password}</div>
156156
)}
157-
<div className="flex-grow"></div>
157+
<div className="flex-grow" />
158158
{baseUrl && (
159159
<a
160160
href={

src/components/Login/LocalLogin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const LocalLogin = ({ revalidate }: LocalLoginProps) => {
120120
typeof errors.password === 'string' && (
121121
<div className="error">{errors.password}</div>
122122
)}
123-
<div className="flex-grow"></div>
123+
<div className="flex-grow" />
124124
{passwordResetEnabled && (
125125
<Link
126126
href="/resetpassword"

src/components/Login/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ const Login = () => {
241241
{additionalLoginOptions.length > 0 &&
242242
(loginFormVisible ? (
243243
<div className="flex items-center py-5">
244-
<div className="flex-grow border-t border-gray-600"></div>
244+
<div className="flex-grow border-t border-gray-600" />
245245
<span className="mx-2 flex-shrink text-sm text-gray-400">
246246
{intl.formatMessage(messages.orsigninwith)}
247247
</span>
248-
<div className="flex-grow border-t border-gray-600"></div>
248+
<div className="flex-grow border-t border-gray-600" />
249249
</div>
250250
) : (
251251
<h2 className="mb-6 text-center text-lg font-bold text-neutral-200">

src/components/RequestModal/CollectionRequestModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ const CollectionRequestModal = ({
340340
className={`${
341341
isAllParts() ? 'bg-indigo-500' : 'bg-gray-800'
342342
} absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out`}
343-
></span>
343+
/>
344344
<span
345345
aria-hidden="true"
346346
className={`${
347347
isAllParts() ? 'translate-x-5' : 'translate-x-0'
348348
} absolute left-0 inline-block h-5 w-5 rounded-full border border-gray-200 bg-white shadow transition-transform duration-200 ease-in-out group-focus:border-blue-300 group-focus:ring`}
349-
></span>
349+
/>
350350
</span>
351351
</th>
352352
<th className="bg-gray-700 bg-opacity-80 px-1 py-3 text-left text-xs font-medium uppercase leading-4 tracking-wider text-gray-200 md:px-6">
@@ -423,7 +423,7 @@ const CollectionRequestModal = ({
423423
? 'bg-indigo-500'
424424
: 'bg-gray-700'
425425
} absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out`}
426-
></span>
426+
/>
427427
<span
428428
aria-hidden="true"
429429
className={`${
@@ -435,7 +435,7 @@ const CollectionRequestModal = ({
435435
? 'translate-x-5'
436436
: 'translate-x-0'
437437
} absolute left-0 inline-block h-5 w-5 rounded-full border border-gray-200 bg-white shadow transition-transform duration-200 ease-in-out group-focus:border-blue-300 group-focus:ring`}
438-
></span>
438+
/>
439439
</span>
440440
</td>
441441
<td

src/components/RequestModal/TvRequestModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,13 @@ const TvRequestModal = ({
557557
className={`${
558558
isAllSeasons() ? 'bg-indigo-500' : 'bg-gray-800'
559559
} absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out`}
560-
></span>
560+
/>
561561
<span
562562
aria-hidden="true"
563563
className={`${
564564
isAllSeasons() ? 'translate-x-5' : 'translate-x-0'
565565
} absolute left-0 inline-block h-5 w-5 rounded-full border border-gray-200 bg-white shadow transition-transform duration-200 ease-in-out group-focus:border-blue-300 group-focus:ring`}
566-
></span>
566+
/>
567567
</span>
568568
</th>
569569
<th className="bg-gray-700 bg-opacity-80 px-1 py-3 text-left text-xs font-medium uppercase leading-4 tracking-wider text-gray-200 md:px-6">
@@ -649,7 +649,7 @@ const TvRequestModal = ({
649649
? 'bg-indigo-500'
650650
: 'bg-gray-700'
651651
} absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out`}
652-
></span>
652+
/>
653653
<span
654654
aria-hidden="true"
655655
className={`${
@@ -662,7 +662,7 @@ const TvRequestModal = ({
662662
? 'translate-x-5'
663663
: 'translate-x-0'
664664
} absolute left-0 inline-block h-5 w-5 rounded-full border border-gray-200 bg-white shadow transition-transform duration-200 ease-in-out group-focus:border-blue-300 group-focus:ring`}
665-
></span>
665+
/>
666666
</span>
667667
</td>
668668
<td className="whitespace-nowrap px-1 py-4 text-sm font-medium leading-5 text-gray-100 md:px-6">

0 commit comments

Comments
 (0)