mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 23:16:21 +00:00
ESLint --fix: auto-fix brace-style, indent, semi, no-trailing-spaces
Run eslint --fix across src/ to clear ~1900 mechanical lint errors surfaced by the @typescript-eslint v8 + react-hooks v7 + react-compiler upgrade in the React 19 modernization PR. Issues fixed automatically: - brace-style (Allman): try/catch one-liners reformatted to multi-line - indent: tab-vs-space and depth corrections - semi: missing trailing semicolons - no-trailing-spaces No semantic changes. Remaining 701 errors are real-code issues (set-state-in-effect, rules-of-hooks, no-unsafe-* type checks) that need manual per-file review. https://claude.ai/code/session_01GrR87LAqnAEyKG2ZbmQt5Q
This commit is contained in:
@@ -52,11 +52,11 @@ const INTERNAL_TOKEN_PREFIX = 'internal:';
|
||||
const GROUP_TOKEN_PREFIX = 'group:';
|
||||
|
||||
const createInternalMeta = (key: string, canUseAsDestination = false, canUseAsReference = false): IInternalVariableMeta =>
|
||||
({
|
||||
key,
|
||||
canUseAsDestination,
|
||||
canUseAsReference
|
||||
});
|
||||
({
|
||||
key,
|
||||
canUseAsDestination,
|
||||
canUseAsReference
|
||||
});
|
||||
|
||||
export const normalizeInternalVariableKey = (key: string) =>
|
||||
{
|
||||
@@ -216,30 +216,30 @@ const getRootKey = (key: string) =>
|
||||
};
|
||||
|
||||
const createInternalEntry = (target: WiredVariablePickerTarget, usage: WiredVariablePickerUsage, meta: IInternalVariableMeta): IWiredVariablePickerEntry =>
|
||||
({
|
||||
id: `${ INTERNAL_TOKEN_PREFIX }${ meta.key }`,
|
||||
token: `${ INTERNAL_TOKEN_PREFIX }${ meta.key }`,
|
||||
label: meta.key,
|
||||
displayLabel: meta.key,
|
||||
searchableText: meta.key,
|
||||
selectable: getInternalSelectable(usage, meta),
|
||||
hasValue: meta.canUseAsReference,
|
||||
kind: 'internal',
|
||||
target
|
||||
});
|
||||
({
|
||||
id: `${ INTERNAL_TOKEN_PREFIX }${ meta.key }`,
|
||||
token: `${ INTERNAL_TOKEN_PREFIX }${ meta.key }`,
|
||||
label: meta.key,
|
||||
displayLabel: meta.key,
|
||||
searchableText: meta.key,
|
||||
selectable: getInternalSelectable(usage, meta),
|
||||
hasValue: meta.canUseAsReference,
|
||||
kind: 'internal',
|
||||
target
|
||||
});
|
||||
|
||||
const createCustomEntry = (target: WiredVariablePickerTarget, usage: WiredVariablePickerUsage, definition: IWiredVariableDefinitionLike): IWiredVariablePickerEntry =>
|
||||
({
|
||||
id: `${ CUSTOM_TOKEN_PREFIX }${ definition.itemId }`,
|
||||
token: `${ CUSTOM_TOKEN_PREFIX }${ definition.itemId }`,
|
||||
label: definition.name,
|
||||
displayLabel: definition.name,
|
||||
searchableText: definition.name,
|
||||
selectable: getCustomSelectable(usage, definition),
|
||||
hasValue: !!definition.hasValue,
|
||||
kind: 'custom',
|
||||
target
|
||||
});
|
||||
({
|
||||
id: `${ CUSTOM_TOKEN_PREFIX }${ definition.itemId }`,
|
||||
token: `${ CUSTOM_TOKEN_PREFIX }${ definition.itemId }`,
|
||||
label: definition.name,
|
||||
displayLabel: definition.name,
|
||||
searchableText: definition.name,
|
||||
selectable: getCustomSelectable(usage, definition),
|
||||
hasValue: !!definition.hasValue,
|
||||
kind: 'custom',
|
||||
target
|
||||
});
|
||||
|
||||
const groupEntries = (entries: IWiredVariablePickerEntry[]) =>
|
||||
{
|
||||
|
||||
@@ -211,6 +211,6 @@ export const WiredActionFurniToFurniView: FC<{}> = () =>
|
||||
onSelectionActivate={ () => switchSelection('target') } />
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -33,12 +33,12 @@ const REWARD_TYPES: { value: RewardType, label: string }[] = [
|
||||
const SELECTABLE_REWARD_TYPES = REWARD_TYPES.filter(entry => (entry.value !== 'respect'));
|
||||
|
||||
const createReward = (): RewardEntry =>
|
||||
({
|
||||
rewardType: 'furni',
|
||||
rewardValue: '',
|
||||
probability: DEFAULT_PROBABILITY,
|
||||
pointsType: DEFAULT_POINTS_TYPE
|
||||
});
|
||||
({
|
||||
rewardType: 'furni',
|
||||
rewardValue: '',
|
||||
probability: DEFAULT_PROBABILITY,
|
||||
pointsType: DEFAULT_POINTS_TYPE
|
||||
});
|
||||
|
||||
const getRewardValuePlaceholder = (rewardType: RewardType) =>
|
||||
{
|
||||
|
||||
@@ -40,13 +40,13 @@ const serializeForwardIds = (ids: number[]): string =>
|
||||
|
||||
export const WiredActionSendSignalView: FC<{}> = () =>
|
||||
{
|
||||
const [ furniSource, setFurniSource ] = useState<number>(SOURCE_TRIGGER);
|
||||
const [ userSource, setUserSource ] = useState<number>(SOURCE_TRIGGER);
|
||||
const [ furniSource, setFurniSource ] = useState<number>(SOURCE_TRIGGER);
|
||||
const [ userSource, setUserSource ] = useState<number>(SOURCE_TRIGGER);
|
||||
const [ signalPerFurni, setSignalPerFurni ] = useState(false);
|
||||
const [ signalPerUser, setSignalPerUser ] = useState(false);
|
||||
const [ antennaIds, setAntennaIds ] = useState<number[]>([]);
|
||||
const [ signalPerUser, setSignalPerUser ] = useState(false);
|
||||
const [ antennaIds, setAntennaIds ] = useState<number[]>([]);
|
||||
const [ forwardFurniIds, setForwardFurniIds ] = useState<number[]>([]);
|
||||
const [ selectionMode, setSelectionMode ] = useState<SelectionMode>('antenna');
|
||||
const [ selectionMode, setSelectionMode ] = useState<SelectionMode>('antenna');
|
||||
const highlightedIds = useRef<number[]>([]);
|
||||
|
||||
const { trigger = null, furniIds = [], setFurniIds = null, setIntParams = null, setStringParam = null } = useWired();
|
||||
@@ -194,7 +194,8 @@ export const WiredActionSendSignalView: FC<{}> = () =>
|
||||
selectionCount={ antennaIds.length }
|
||||
selectionLimit={ selectionLimit }
|
||||
selectionEnabledValues={ [ SOURCE_SELECTED ] }
|
||||
onChange={ () => {} }
|
||||
onChange={ () =>
|
||||
{} }
|
||||
onSelectionActivate={ () => switchSelection('antenna') } />
|
||||
<WiredFurniSelectionSourceRow
|
||||
title="Furni da mandare avanti:"
|
||||
@@ -222,7 +223,7 @@ export const WiredActionSendSignalView: FC<{}> = () =>
|
||||
onChange={ setUserSource } />
|
||||
</div>
|
||||
}
|
||||
>
|
||||
>
|
||||
<div className="flex flex-col gap-3">
|
||||
<Text bold>{ LocalizeText('wiredfurni.params.signal.options') }</Text>
|
||||
<div className="form-check">
|
||||
|
||||
@@ -221,7 +221,7 @@ export const WiredConditionFurniIsOfTypeView: FC<WiredConditionFurniIsOfTypeView
|
||||
onSelectionActivate={ () => switchSelection('secondary') } />
|
||||
</div>
|
||||
}
|
||||
>
|
||||
>
|
||||
<div className="flex flex-col gap-2">
|
||||
<Text bold>{ LocalizeText('wiredfurni.params.quantifier_selection') }</Text>
|
||||
{ [ 0, 1 ].map(value => (
|
||||
|
||||
@@ -127,7 +127,7 @@ export const WiredExtraFilterByVariableView: FC<WiredExtraFilterByVariableViewPr
|
||||
if(!variableToken) return mainEntries;
|
||||
if(flattenWiredVariablePickerEntries(mainEntries).some(entry => (entry.token === variableToken))) return mainEntries;
|
||||
|
||||
const fallbackEntry = createFallbackVariableEntry(target as WiredVariablePickerTarget, variableToken);
|
||||
const fallbackEntry = createFallbackVariableEntry(target, variableToken);
|
||||
return fallbackEntry ? [ fallbackEntry, ...mainEntries ] : mainEntries;
|
||||
}, [ mainEntries, target, variableToken ]);
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ export const WiredExtraTextInputVariableView: FC<{}> = () =>
|
||||
|
||||
const itemId = getCustomVariableItemId(variableToken);
|
||||
|
||||
return (targetDefinitions.find(definition => (definition.itemId === itemId)) ?? null) as IVariableDefinition | null;
|
||||
return (targetDefinitions.find(definition => (definition.itemId === itemId)) ?? null);
|
||||
}, [ targetDefinitions, variableToken ]);
|
||||
|
||||
const canUseTextDisplay = !!selectedVariableDefinition?.isTextConnected;
|
||||
|
||||
@@ -101,7 +101,7 @@ export const WiredActionFurniAreaView: FC<{}> = props =>
|
||||
: 0;
|
||||
|
||||
return (
|
||||
<WiredSelectorBaseView hasSpecialInput={ true } requiresFurni={ 0 } save={ save } hideDelay={ true } cardStyle={ { width: '385px'} }>
|
||||
<WiredSelectorBaseView hasSpecialInput={ true } requiresFurni={ 0 } save={ save } hideDelay={ true } cardStyle={ { width: '385px' } }>
|
||||
<div className="flex flex-col gap-2">
|
||||
<Text bold>{ LocalizeText('wiredfurni.params.area_selection') }</Text>
|
||||
<Text small>{ LocalizeText('wiredfurni.params.area_selection.info') }</Text>
|
||||
|
||||
@@ -4,13 +4,13 @@ import { Text } from '../../../../common';
|
||||
import { useWired } from '../../../../hooks';
|
||||
import { WiredSelectorBaseView } from './WiredSelectorBaseView';
|
||||
|
||||
const SOURCE_FURNI_PICKED = 0;
|
||||
const SOURCE_FURNI_PICKED = 0;
|
||||
|
||||
export const WiredSelectorFurniByTypeView: FC<{}> = () =>
|
||||
{
|
||||
const [ matchState, setMatchState ] = useState(false);
|
||||
const [ matchState, setMatchState ] = useState(false);
|
||||
const [ filterExisting, setFilterExisting ] = useState(false);
|
||||
const [ invert, setInvert ] = useState(false);
|
||||
const [ invert, setInvert ] = useState(false);
|
||||
|
||||
const { trigger = null, setIntParams } = useWired();
|
||||
|
||||
@@ -28,9 +28,9 @@ export const WiredSelectorFurniByTypeView: FC<{}> = () =>
|
||||
{
|
||||
setIntParams([
|
||||
SOURCE_FURNI_PICKED,
|
||||
matchState ? 1 : 0,
|
||||
filterExisting ? 1 : 0,
|
||||
invert ? 1 : 0,
|
||||
matchState ? 1 : 0,
|
||||
filterExisting ? 1 : 0,
|
||||
invert ? 1 : 0,
|
||||
]);
|
||||
}, [ matchState, filterExisting, invert, setIntParams ]);
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ export const WiredSelectorWithVariableView: FC<WiredSelectorWithVariableViewProp
|
||||
if(!variableToken) return mainEntries;
|
||||
if(flattenWiredVariablePickerEntries(mainEntries).some(entry => (entry.token === variableToken))) return mainEntries;
|
||||
|
||||
const fallbackEntry = createFallbackVariableEntry(selectorTarget as WiredVariablePickerTarget, variableToken);
|
||||
const fallbackEntry = createFallbackVariableEntry(selectorTarget, variableToken);
|
||||
return fallbackEntry ? [ fallbackEntry, ...mainEntries ] : mainEntries;
|
||||
}, [ mainEntries, selectorTarget, variableToken ]);
|
||||
const selectedMainEntry = useMemo(() => flattenWiredVariablePickerEntries(resolvedMainEntries).find(entry => (entry.token === variableToken)) || null, [ resolvedMainEntries, variableToken ]);
|
||||
|
||||
Reference in New Issue
Block a user