Skip to content
Snippets Groups Projects
Commit c0b865ea authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Prettify & lint.

parent aed56b03
Branches
Tags
No related merge requests found
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import { import {
type Aggregate, type Aggregate,
type Article, type Article,
type LegalObject,
type LegalObjectType, type LegalObjectType,
type Lien, type Lien,
pathnameFromLegalId, pathnameFromLegalId,
...@@ -30,7 +29,7 @@ ...@@ -30,7 +29,7 @@
return undefined return undefined
} }
switch (type) { switch (type) {
case "article": case "article": {
const article = await retrieveLegifranceArticle(id) const article = await retrieveLegifranceArticle(id)
if (article === undefined) { if (article === undefined) {
return undefined return undefined
...@@ -39,6 +38,7 @@ ...@@ -39,6 +38,7 @@
component: ArticleView, component: ArticleView,
properties: { article, level }, properties: { article, level },
} }
}
default: default:
console.warn( console.warn(
`LienView.componentAndPropertiesFromTypeAndTarget: Document type ${type} not handled yet`, `LienView.componentAndPropertiesFromTypeAndTarget: Document type ${type} not handled yet`,
......
<script lang="ts"> <script lang="ts">
import Icon from "@iconify/svelte" import Icon from "@iconify/svelte"
import type { import type { ScaleParameter, ValueParameter } from "@openfisca/json-model"
Reference,
ScaleParameter,
ValueParameter,
} from "@openfisca/json-model"
import { import {
Dialog, Dialog,
DialogDescription, DialogDescription,
......
<script lang="ts"> <script lang="ts">
import { newSimulationUrl } from "$lib/urls"
import type { DisplayMode } from "$lib/displays" import type { DisplayMode } from "$lib/displays"
import Icon from "@iconify/svelte" import { newSimulationUrl } from "$lib/urls"
export let displayMode: DisplayMode export let displayMode: DisplayMode
</script> </script>
......
...@@ -126,7 +126,7 @@ export function extractInputInstantsFromTestCases( ...@@ -126,7 +126,7 @@ export function extractInputInstantsFromTestCases(
} = {} } = {}
inputInstantsByVariableNameArray.push(inputInstantsByVariableName) inputInstantsByVariableNameArray.push(inputInstantsByVariableName)
for (const entity of entities) { for (const entity of entities) {
let entitySituation = situation[entity.key_plural] const entitySituation = situation[entity.key_plural]
if (entitySituation === undefined) { if (entitySituation === undefined) {
continue continue
} }
......
...@@ -2,10 +2,9 @@ import { strictAudit } from "@auditors/core" ...@@ -2,10 +2,9 @@ import { strictAudit } from "@auditors/core"
import { import {
auditEditableParameter, auditEditableParameter,
convertEditableParameterToRaw, convertEditableParameterToRaw,
type JsonValue,
type Parameter,
ParameterClass, ParameterClass,
yamlFromRawParameter, yamlFromRawParameter,
type Parameter,
} from "@openfisca/json-model" } from "@openfisca/json-model"
import { error } from "@sveltejs/kit" import { error } from "@sveltejs/kit"
import { randomBytes } from "crypto" import { randomBytes } from "crypto"
......
...@@ -34,7 +34,7 @@ export const load: PageLoad = async function ({ fetch, params, parent }) { ...@@ -34,7 +34,7 @@ export const load: PageLoad = async function ({ fetch, params, parent }) {
if (processedParameter.class === ParameterClass.Node) { if (processedParameter.class === ParameterClass.Node) {
unprocessedParameterUrl += "/index.yaml" unprocessedParameterUrl += "/index.yaml"
} }
let unprocessedParameterResponse = await fetch(unprocessedParameterUrl) const unprocessedParameterResponse = await fetch(unprocessedParameterUrl)
if (!unprocessedParameterResponse.ok) { if (!unprocessedParameterResponse.ok) {
throw error(500, `Could not load ${unprocessedParameterUrl}`) throw error(500, `Could not load ${unprocessedParameterUrl}`)
} }
......
import { redirect } from '@sveltejs/kit'; import { redirect } from "@sveltejs/kit"
import type { LoadOutput } from "@sveltejs/kit"
export function load(): PageLoadOutput { import type { PageLoad } from "./$types"
throw redirect(301, "/");
export const load: PageLoad = function () {
throw redirect(301, "/")
} }
import { json as json$1 } from '@sveltejs/kit';
import type { Audit } from "@auditors/core" import type { Audit } from "@auditors/core"
import { auditCleanArray, auditRequire, cleanAudit } from "@auditors/core" import { auditCleanArray, auditRequire, cleanAudit } from "@auditors/core"
import type { JsonValue } from "@openfisca/json-model" import type { JsonValue } from "@openfisca/json-model"
import type { RequestHandler } from "@sveltejs/kit" import { json, type RequestHandler } from "@sveltejs/kit"
import fs from "fs-extra" import fs from "fs-extra"
import path from "path" import path from "path"
import { XXHash3 } from "xxhash-addon" import { XXHash3 } from "xxhash-addon"
...@@ -74,7 +73,8 @@ export const POST: RequestHandler = async ({ request, url }) => { ...@@ -74,7 +73,8 @@ export const POST: RequestHandler = async ({ request, url }) => {
2, 2,
)}\n\nError:\n${JSON.stringify(bodyError, null, 2)}`, )}\n\nError:\n${JSON.stringify(bodyError, null, 2)}`,
) )
return json$1({ return json(
{
error: { error: {
code: 400, code: 400,
details: bodyError as JsonValue, details: bodyError as JsonValue,
...@@ -82,9 +82,11 @@ export const POST: RequestHandler = async ({ request, url }) => { ...@@ -82,9 +82,11 @@ export const POST: RequestHandler = async ({ request, url }) => {
pathname: url.pathname, pathname: url.pathname,
}, },
body: body as JsonValue, body: body as JsonValue,
}, { },
status: 400 {
}) status: 400,
},
)
} }
const bodyJson = JSON.stringify(body, null, 2) const bodyJson = JSON.stringify(body, null, 2)
const hasher = new XXHash3() const hasher = new XXHash3()
...@@ -98,5 +100,5 @@ export const POST: RequestHandler = async ({ request, url }) => { ...@@ -98,5 +100,5 @@ export const POST: RequestHandler = async ({ request, url }) => {
await fs.writeFile(simulationFilePath, bodyJson) await fs.writeFile(simulationFilePath, bodyJson)
} }
return json$1({ token: digest }) return json({ token: digest })
} }
<script lang="ts"> <script lang="ts">
import type { Variable } from "@openfisca/json-model"
import { getContext, setContext } from "svelte" import { getContext, setContext } from "svelte"
import type { Writable } from "svelte/store" import type { Writable } from "svelte/store"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment