Skip to content

Commit

Permalink
feat: prettier --write
Browse files Browse the repository at this point in the history
  • Loading branch information
velomovies committed Jul 11, 2023
1 parent 738c13f commit c2054dd
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/RenderResults/RenderResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function CodeEditor({ value, fieldType }: Props) {
}}
switchInputProps={{
disabled: true,
name: "computed-field--boolean",
name: 'computed-field--boolean',
value,
}}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/entrypoints/FieldExtension/FieldExtension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ export default function FieldExtension({ ctx }: Props) {
async (
ctx: RenderFieldExtensionCtx,
codeToExecute: string,
changedField?: string
changedField?: string,
) => {
const codeResult = await executeComputedCode(
ctx,
codeToExecute,
changedField
changedField,
)
setFieldValue(codeResult)
return codeResult
},
[]
[],
)

const ctxFieldPathLastIndexOfDot = ctx.fieldPath.lastIndexOf('.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ type Props = {
export default function FieldExtensionConfigScreen({ ctx }: Props) {
const pluginParameters = ctx.parameters
const [editFunctionValue, setEditFunctionValue] = useState<boolean>(
Boolean(pluginParameters?.editFunction)
Boolean(pluginParameters?.editFunction),
)
const [hideFieldValue, setHideFieldValue] = useState<boolean>(
Boolean(pluginParameters?.hideField)
Boolean(pluginParameters?.hideField),
)
const [defaultFunction, setDefaultFunction] = useState<string>(
pluginParameters?.defaultFunction
? String(pluginParameters?.defaultFunction)
: ''
: '',
)

function handleEditFunctionChange(newValue: boolean) {
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ connect({
},
renderManualFieldExtensionConfigScreen(
_,
ctx: RenderManualFieldExtensionConfigScreenCtx
ctx: RenderManualFieldExtensionConfigScreenCtx,
) {
return render(<FieldExtensionConfigScreen ctx={ctx} />)
},
Expand Down
2 changes: 1 addition & 1 deletion src/lib/executeComputedCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Variables {
export default async function executeComputedCode(
ctx: RenderFieldExtensionCtx,
codeToExecute: string,
changedField?: string
changedField?: string,
) {
let datoClient: any
const accessTokenError: string =
Expand Down
2 changes: 1 addition & 1 deletion src/lib/getFieldValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import get from 'lodash/get'

export default function getFieldValue(object: object, fieldName: string): any {
return get(object, fieldName)
}
}
2 changes: 1 addition & 1 deletion src/lib/migrateFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async function migrateFields(ctx: OnBootCtx, fieldId: string) {
newFieldExtensionId: fieldId,
},
])
})
}),
)

// save in configuration the fact that we already performed the migration
Expand Down
7 changes: 5 additions & 2 deletions src/lib/saveFieldValue.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { RenderFieldExtensionCtx } from 'datocms-plugin-sdk'

export default function saveFieldValue(ctx: RenderFieldExtensionCtx, fieldValue: any) {
export default function saveFieldValue(
ctx: RenderFieldExtensionCtx,
fieldValue: any,
) {
const fieldType: string = ctx.field.attributes.field_type
const fieldPath: string = ctx.fieldPath

Expand All @@ -15,4 +18,4 @@ export default function saveFieldValue(ctx: RenderFieldExtensionCtx, fieldValue:
return fieldValue
}
}
}
}
10 changes: 2 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -20,7 +16,5 @@
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
"include": ["src"]
}

0 comments on commit c2054dd

Please sign in to comment.