Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 1c8c5e7

Browse files
committed
chore: enable naming-conventation lint
1 parent 06b7347 commit 1c8c5e7

6 files changed

Lines changed: 17 additions & 13 deletions

File tree

apps/ui/components/common/PageWrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Navigation from "./Navigation";
88
import { InProgressReservationNotification } from "@/components/reservations/UnpaidReservationNotification";
99
import { mainStyles } from "common/styles/layout";
1010

11-
interface Props {
11+
interface PageProps {
1212
children: React.ReactNode;
1313
overrideBackgroundColor?: string;
1414
apiBaseUrl: string;
@@ -27,7 +27,7 @@ function PageWrapper({
2727
feedbackUrl,
2828
children,
2929
version,
30-
}: Props): JSX.Element {
30+
}: PageProps): JSX.Element {
3131
return (
3232
<>
3333
<Head>

apps/ui/components/recurring/ApplicationRoundCard.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Card from "common/src/components/Card";
1212
import { ButtonLikeLink } from "@/components/common/ButtonLikeLink";
1313
import { getApplicationRoundPath } from "@/modules/urls";
1414

15-
interface Props {
15+
interface CardProps {
1616
applicationRound: ApplicationRoundFieldsFragment;
1717
}
1818

@@ -43,7 +43,9 @@ function translateRoundDate(
4343
}
4444
}
4545

46-
export function ApplicationRoundCard({ applicationRound }: Props): JSX.Element {
46+
export function ApplicationRoundCard({
47+
applicationRound,
48+
}: CardProps): JSX.Element {
4749
const { t } = useTranslation();
4850

4951
const state = applicationRound.status;

apps/ui/components/reservation-unit/Head.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { Flex } from "common/styles/util";
2222
import { breakpoints } from "common";
2323

2424
type QueryT = NonNullable<ReservationUnitPageQuery["reservationUnit"]>;
25-
interface Props {
25+
interface HeadProps {
2626
reservationUnit: QueryT;
2727
reservationUnitIsReservable?: boolean;
2828
subventionSuffix?: JSX.Element;
@@ -80,7 +80,7 @@ export function Head({
8080
reservationUnit,
8181
reservationUnitIsReservable,
8282
subventionSuffix,
83-
}: Props): JSX.Element {
83+
}: HeadProps): JSX.Element {
8484
const reservationUnitName = getReservationUnitName(reservationUnit);
8585
const unitName = getUnitName(reservationUnit.unit ?? undefined);
8686

@@ -123,7 +123,7 @@ const IconListWrapper = styled.div`
123123
function IconList({
124124
reservationUnit,
125125
subventionSuffix,
126-
}: Pick<Props, "reservationUnit" | "subventionSuffix">): JSX.Element {
126+
}: Pick<HeadProps, "reservationUnit" | "subventionSuffix">): JSX.Element {
127127
const { t } = useTranslation();
128128

129129
const minDur = reservationUnit.minReservationDuration ?? 0;

apps/ui/components/search/ReservationUnitCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { getReservationUnitPath } from "@/modules/urls";
1717
import { ButtonLikeLink } from "../common/ButtonLikeLink";
1818

1919
type Node = ReservationUnitCardFieldsFragment;
20-
interface IProps {
20+
interface CardProps {
2121
reservationUnit: Node;
2222
selectReservationUnit: (reservationUnit: Node) => void;
2323
containsReservationUnit: (reservationUnit: Node) => boolean;
@@ -29,7 +29,7 @@ export function ReservationUnitCard({
2929
selectReservationUnit,
3030
containsReservationUnit,
3131
removeReservationUnit,
32-
}: IProps): JSX.Element {
32+
}: CardProps): JSX.Element {
3333
const { t } = useTranslation();
3434

3535
const name = getReservationUnitName(reservationUnit);

packages/common/src/components/form/ControlledSelect.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
type UseControllerProps,
1010
} from "react-hook-form";
1111

12-
interface Props<T extends FieldValues> extends UseControllerProps<T> {
12+
interface SelectProps<T extends FieldValues> extends UseControllerProps<T> {
1313
name: Path<T>;
1414
control: Control<T>;
1515
label: string;
@@ -47,7 +47,7 @@ export function ControlledSelect<T extends FieldValues>({
4747
multiselect,
4848
disabled,
4949
afterChange,
50-
}: Props<T>): JSX.Element {
50+
}: SelectProps<T>): JSX.Element {
5151
const { t } = useTranslation(["common"]);
5252
const {
5353
field: { value, onChange },

packages/eslint-config-custom/react.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ module.exports = defineConfig({
9898
"@typescript-eslint/no-unsafe-return": 0,
9999
"@typescript-eslint/no-unnecessary-type-arguments": 0,
100100
// TODO there should be rules for this already
101-
"@typescript-eslint/naming-convention": 0,
102101
"no-implicit-coercion": 0,
103102
"import/no-named-as-default-member": 0,
104103
"import/no-named-as-default": 0,
@@ -181,7 +180,6 @@ module.exports = defineConfig({
181180
},
182181
],
183182
"react/destructuring-assignment": 0,
184-
"react/jsx-props-no-spreading": 0,
185183
"react/prop-types": 0,
186184
"react/require-default-props": 0,
187185
"react/static-property-placement": 0,
@@ -192,6 +190,10 @@ module.exports = defineConfig({
192190
unnamedComponents: ["function-expression", "arrow-function"],
193191
},
194192
],
193+
// Custom rule to enforce data-testid attribute naming
194+
'react/no-unknown-property': ['error', {
195+
requireDataLowercase: true,
196+
}],
195197
// There seems to be no other way to override this than disabling it and rewriting the rules in the naming-convention
196198
"@typescript-eslint/camelcase": ["off"],
197199
"@typescript-eslint/no-empty-function": 0,

0 commit comments

Comments
 (0)