diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000000000000000000000000000000000..38972655faff07d2cc0383044bbf9f43b22c2248 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,13 @@ +.DS_Store +node_modules +/build +/.svelte-kit +/package +.env +.env.* +!.env.example + +# Ignore files for PNPM, NPM and YARN +pnpm-lock.yaml +package-lock.json +yarn.lock diff --git a/.eslintrc.cjs b/.eslintrc.cjs index c4721b59f44361cef85cde0cfc037af5810b52ea..fe58b1d131e3ac494eff6789da29e256957f68da 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -15,7 +15,7 @@ module.exports = { parser: "@typescript-eslint/parser", parserOptions: { sourceType: "module", - ecmaVersion: 2019, + ecmaVersion: 2020, }, root: true, settings: { diff --git a/package.json b/package.json index 21d6d72ef08062611b7539184de9f049c17b6bfb..a6915da70303e7566965e4d007317acc34df07b1 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "0.0.288", "scripts": { "build": "NODE_OPTIONS=--max_old_space_size=4096 vite build", - "check": "svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "dev": "vite dev", - "format": "prettier --write --plugin-search-dir=. .", + "format": "prettier --plugin-search-dir=. --write .", "lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .", "preview": "vite preview", "test": "playwright test" diff --git a/svelte.config.js b/svelte.config.js index c518c6f1f66522b4bde386434d0a6fe133a49164..35a6f095d1d474bef5990e6eb76b3488156f12c4 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,13 +1,13 @@ -import node from "@sveltejs/adapter-node" +import adapter from "@sveltejs/adapter-node" import preprocess from "svelte-preprocess" /** @type {import('@sveltejs/kit').Config} */ -const svelteKitConfig = { +const config = { kit: { // By default, `npm run build` will create a standard Node app. // You can create optimized builds for different platforms by // specifying a different adapter - adapter: node({ + adapter: adapter({ precompress: true, }), @@ -19,7 +19,11 @@ const svelteKitConfig = { // Consult https://github.com/sveltejs/svelte-preprocess // for more information about preprocessors - preprocess: [preprocess({})], + preprocess: [ + preprocess({ + postcss: true, + }), + ], } -export default svelteKitConfig +export default config diff --git a/tsconfig.json b/tsconfig.json index 92b24c34f6b0d8919a067282d4bfa05bd8822170..794b95b6426836ad7f5e8683729dd758e7f2bc7c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,10 @@ "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, - "strict": false + "strict": true } + // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias + // + // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes + // from the referenced tsconfig.json - TypeScript does not merge them in } diff --git a/vite.config.js b/vite.config.ts similarity index 87% rename from vite.config.js rename to vite.config.ts index 3d62bc8a7c3df0c8a9fb0601dcd98a0218af0550..77b6a0c7184f74c7fa955858031f5a30ccd37648 100644 --- a/vite.config.js +++ b/vite.config.ts @@ -1,7 +1,7 @@ import { sveltekit } from "@sveltejs/kit/vite" +import type { UserConfig } from "vite" -/** @type {import('vite').UserConfig} */ -const config = { +const config: UserConfig = { build: { // Increase size of chunks to 5 MB, to be able to import // JSON files extracted from OpenFisca country package.