Re-add prettier (#13812)

Re add prettier in eslint.configs
This commit is contained in:
Charles Bochet
2025-08-11 14:10:04 +02:00
committed by GitHub
parent c8d8fb20c9
commit b14063fe06
168 changed files with 675 additions and 352 deletions
@@ -5,10 +5,12 @@ import { FieldMetadataType, RelationType } from '~/generated-metadata/graphql';
export type GenerateEmptyFieldValueArgs = {
fieldMetadataItem: Pick<FieldMetadataItem, 'type' | 'relation'>;
shouldComputeFunctionDefaultValue?: boolean;
};
// TODO strictly type each fieldValue following their FieldMetadataType
export const generateEmptyFieldValue = ({
fieldMetadataItem,
shouldComputeFunctionDefaultValue = false,
}: GenerateEmptyFieldValueArgs) => {
switch (fieldMetadataItem.type) {
case FieldMetadataType.TEXT: {
@@ -39,9 +41,15 @@ export const generateEmptyFieldValue = ({
};
}
case FieldMetadataType.DATE_TIME: {
if (shouldComputeFunctionDefaultValue) {
return new Date().toISOString();
}
return null;
}
case FieldMetadataType.DATE: {
if (shouldComputeFunctionDefaultValue) {
return new Date().toISOString();
}
return null;
}
case FieldMetadataType.NUMBER: