Skip to content

Commit

Permalink
[MIRROR] Fixes some eslint issues [MDB IGNORE] (#808)
Browse files Browse the repository at this point in the history
* Fixes some eslint issues (#79897)

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Jeremiah <[email protected]>
  • Loading branch information
3 people authored Nov 24, 2023
1 parent cb6d7cd commit ca6703b
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tgui/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ rules:
## Enforce ES5 or ES6 class for React Components
react/prefer-es6-class: error
## Enforce that props are read-only
react/prefer-read-only-props: error
react/prefer-read-only-props: off
## Enforce stateless React Components to be written as a pure function
react/prefer-stateless-function: error
## Prevent missing props validation in a React component definition
Expand Down
2 changes: 1 addition & 1 deletion tgui/packages/tgui/interfaces/BountyBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const BountyBoardContent = (props, context) => {
{applicants?.map(
(applicant) =>
applicant.request_id === request.acc_number && (
<Flex>
<Flex key={applicant.request_id}>
<Flex.Item
grow={1}
p={0.5}
Expand Down
7 changes: 6 additions & 1 deletion tgui/packages/tgui/interfaces/HotkeysHelp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ export const HotkeysHelp = (props, context) => {
</Box>
</Tooltip>
) : (
<Box p={1} m={1} inline className="HotkeysHelp__pill">
<Box
key={binding.name}
p={1}
m={1}
inline
className="HotkeysHelp__pill">
{binding.name}
</Box>
)
Expand Down
6 changes: 5 additions & 1 deletion tgui/packages/tgui/interfaces/PreferencesMenu/QuirksPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ const QuirkList = (props: {
);

if (quirk.failTooltip) {
return <Tooltip content={quirk.failTooltip}>{child}</Tooltip>;
return (
<Tooltip key={quirkKey} content={quirk.failTooltip}>
{child}
</Tooltip>
);
} else {
return child;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ export type FeatureValueProps<
TReceiving,
TSending = TReceiving,
TServerData = undefined
> = {
> = Readonly<{
act: typeof sendAct;
featureId: string;
handleSetValue: (newValue: TSending) => void;
serverData: TServerData | undefined;
shrink?: boolean;
value: TReceiving;
};
}>;

export const FeatureColorInput = (props: FeatureValueProps<string>) => {
return (
Expand Down
4 changes: 2 additions & 2 deletions tgui/packages/tgui/interfaces/QuantumConsole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ const DisplayDetails = (props: DisplayDetailsProps, context) => {
<TableCell>
<Stack>
{Array.from({ length: amount }, (_, index) => (
<Stack.Item>
<Icon color={color} key={index} name={icon} />
<Stack.Item key={index}>
<Icon color={color} name={icon} />
</Stack.Item>
))}
</Stack>
Expand Down
6 changes: 3 additions & 3 deletions tgui/packages/tgui/interfaces/StackCrafting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,18 @@ const RecipeListBox = (props: RecipeListProps) => {

return (
<>
{Object.keys(recipes).map((title) => {
{Object.keys(recipes).map((title, index) => {
const recipe = recipes[title];
if (isRecipeList(recipe)) {
return (
<Collapsible ml={1} color="label" title={title}>
<Collapsible key={title} ml={1} color="label" title={title}>
<Box ml={2}>
<RecipeListBox recipes={recipe} />
</Box>
</Collapsible>
);
} else {
return <RecipeBox title={title} recipe={recipe} />;
return <RecipeBox key={title} title={title} recipe={recipe} />;
}
})}
</>
Expand Down
6 changes: 3 additions & 3 deletions tgui/packages/tgui/interfaces/common/GasmixParser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ export const GasmixParser = (props: GasmixParserProps, context) => {
) : (
<LabeledList.Item label="Gas Reactions">
{reactions.length
? reactions.map((reaction) =>
? reactions.map((reaction, index) =>
reactionOnClick ? (
<Box mb="0.5em">
<Box key={reaction[1]} mb="0.5em">
<Button
content={reaction[1]}
onClick={() => reactionOnClick(reaction[0])}
/>
</Box>
) : (
<div>{reaction[1]}</div>
<div key={reaction[1]}>{reaction[1]}</div>
)
)
: 'No reactions detected'}
Expand Down

0 comments on commit ca6703b

Please sign in to comment.