Chore(front): Create a custom eslint rule for Props naming (#1904)

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
This commit is contained in:
gitstart-twenty
2023-10-09 17:31:13 +03:00
committed by GitHub
parent 84ed9edefe
commit 77a1840611
170 changed files with 700 additions and 342 deletions

View File

@ -17,7 +17,7 @@ export enum AutosizeTextInputVariant {
Button = 'button',
}
type OwnProps = {
type AutosizeTextInputProps = {
onValidate?: (text: string) => void;
minRows?: number;
placeholder?: string;
@ -114,7 +114,7 @@ export const AutosizeTextInput = ({
onFocus,
variant = AutosizeTextInputVariant.Icon,
buttonTitle,
}: OwnProps) => {
}: AutosizeTextInputProps) => {
const [isFocused, setIsFocused] = useState(false);
const [isHidden, setIsHidden] = useState(
variant === AutosizeTextInputVariant.Button,

View File

@ -17,12 +17,12 @@ const StyledEditableBooleanFieldValue = styled.div`
margin-left: ${({ theme }) => theme.spacing(1)};
`;
type OwnProps = {
type BooleanInputProps = {
value: boolean;
onToggle?: (newValue: boolean) => void;
};
export const BooleanInput = ({ value, onToggle }: OwnProps) => {
export const BooleanInput = ({ value, onToggle }: BooleanInputProps) => {
const [internalValue, setInternalValue] = useState(value);
useEffect(() => {

View File

@ -19,7 +19,7 @@ export enum CheckboxSize {
Small = 'small',
}
type OwnProps = {
type CheckboxProps = {
checked: boolean;
indeterminate?: boolean;
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
@ -116,7 +116,7 @@ export const Checkbox = ({
variant = CheckboxVariant.Primary,
size = CheckboxSize.Small,
shape = CheckboxShape.Squared,
}: OwnProps) => {
}: CheckboxProps) => {
const [isInternalChecked, setIsInternalChecked] =
React.useState<boolean>(false);

View File

@ -29,7 +29,7 @@ const StyledInputContainer = styled.div`
width: 100%;
`;
export type DateInputEditProps = {
export type DateInputProps = {
value: Nullable<Date>;
onEnter: (newDate: Nullable<Date>) => void;
onEscape: (newDate: Nullable<Date>) => void;
@ -46,7 +46,7 @@ export const DateInput = ({
onEnter,
onEscape,
onClickOutside,
}: DateInputEditProps) => {
}: DateInputProps) => {
const theme = useTheme();
const [internalValue, setInternalValue] = useState(value);

View File

@ -24,7 +24,7 @@ const StyledContainer = styled.div`
}
`;
type OwnProps = {
type DoubleTextInputProps = {
firstValue: string;
secondValue: string;
firstValuePlaceholder: string;
@ -51,7 +51,7 @@ export const DoubleTextInput = ({
onEscape,
onShiftTab,
onTab,
}: OwnProps) => {
}: DoubleTextInputProps) => {
const [firstInternalValue, setFirstInternalValue] = useState(firstValue);
const [secondInternalValue, setSecondInternalValue] = useState(secondValue);

View File

@ -4,7 +4,7 @@ import styled from '@emotion/styled';
import { StyledInput } from '@/ui/input/components/TextInput';
import { ComputeNodeDimensions } from '@/ui/utilities/dimensions/components/ComputeNodeDimensions';
export type DoubleTextInputEditProps = {
export type EntityTitleDoubleTextInputProps = {
firstValue: string;
secondValue: string;
firstValuePlaceholder: string;
@ -38,7 +38,7 @@ export const EntityTitleDoubleTextInput = ({
firstValuePlaceholder,
secondValuePlaceholder,
onChange,
}: DoubleTextInputEditProps) => (
}: EntityTitleDoubleTextInputProps) => (
<StyledDoubleTextContainer>
<ComputeNodeDimensions node={firstValue || firstValuePlaceholder}>
{(nodeDimensions) => (

View File

@ -68,7 +68,7 @@ const StyledCustomPhoneInput = styled(ReactPhoneNumberInput)`
}
`;
export type PhoneCellEditProps = {
export type PhoneInputProps = {
placeholder?: string;
autoFocus?: boolean;
value: string;
@ -89,7 +89,7 @@ export const PhoneInput = ({
onShiftTab,
onClickOutside,
hotkeyScope,
}: PhoneCellEditProps) => {
}: PhoneInputProps) => {
const [internalValue, setInternalValue] = useState<string | undefined>(value);
const wrapperRef = useRef<HTMLDivElement | null>(null);

View File

@ -57,12 +57,15 @@ const PROBABILITY_VALUES = [
{ label: '100%', value: 100 },
];
type OwnProps = {
type ProbabilityInputProps = {
probabilityIndex: number | null;
onChange: (newValue: number) => void;
};
export const ProbabilityInput = ({ onChange, probabilityIndex }: OwnProps) => {
export const ProbabilityInput = ({
onChange,
probabilityIndex,
}: ProbabilityInputProps) => {
const [hoveredProbabilityIndex, setHoveredProbabilityIndex] = useState<
number | null
>(null);

View File

@ -11,7 +11,7 @@ export const StyledInput = styled.input`
${textInputStyle}
`;
type OwnProps = {
type TextInputProps = {
placeholder?: string;
autoFocus?: boolean;
value: string;
@ -33,7 +33,7 @@ export const TextInput = ({
onTab,
onShiftTab,
onClickOutside,
}: OwnProps) => {
}: TextInputProps) => {
const [internalText, setInternalText] = useState(value);
const wrapperRef = useRef(null);