diff --git a/web/.editorconfig b/web/.editorconfig new file mode 100644 index 0000000..57bda5a --- /dev/null +++ b/web/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true + +[*.astro] +indent_style = tab + +[*.{ts,js,svelte,scss,json}] +indent_style = space +indent_size = 2 diff --git a/web/.gitignore b/web/.gitignore index b8a4815..d333b9f 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -19,3 +19,5 @@ dist/ # macOS crap .DS_Store + +.vscode/ diff --git a/web/.nvmrc b/web/.nvmrc new file mode 100644 index 0000000..0a49261 --- /dev/null +++ b/web/.nvmrc @@ -0,0 +1 @@ +24.11.0 diff --git a/web/.prettierignore b/web/.prettierignore new file mode 100644 index 0000000..21560d1 --- /dev/null +++ b/web/.prettierignore @@ -0,0 +1,17 @@ +dist/ +.astro/ +node_modules/ +.vercel/ +yarn.lock +public/ +*.md + +# Astro files with adjacent JSX elements that prettier-plugin-astro cannot parse +src/components/things/DockerDetailedInfo.astro +src/components/things/GitHubDetailedInfo.astro +src/components/things/IosAppDetailedInfo.astro +src/components/things/ItemGitHubMetrics.astro +src/components/things/PrivacyPolicyDetails.astro +src/components/things/WebsiteDetailedInfo.astro +src/pages/*section*.astro +src/pages/all.astro diff --git a/web/.prettierrc b/web/.prettierrc new file mode 100644 index 0000000..47f5a56 --- /dev/null +++ b/web/.prettierrc @@ -0,0 +1,22 @@ +{ + "useTabs": true, + "singleQuote": true, + "semi": true, + "trailingComma": "all", + "plugins": ["prettier-plugin-astro", "prettier-plugin-svelte"], + "overrides": [ + { + "files": "*.astro", + "options": { + "parser": "astro" + } + }, + { + "files": ["*.ts", "*.js", "*.svelte", "*.scss"], + "options": { + "useTabs": false, + "tabWidth": 2 + } + } + ] +} diff --git a/web/.vscode/extensions.json b/web/.vscode/extensions.json deleted file mode 100644 index 22a1505..0000000 --- a/web/.vscode/extensions.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] -} diff --git a/web/.vscode/launch.json b/web/.vscode/launch.json deleted file mode 100644 index d642209..0000000 --- a/web/.vscode/launch.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] -} diff --git a/web/.yarnrc.yml b/web/.yarnrc.yml index 651c1d1..41a8cf6 100644 --- a/web/.yarnrc.yml +++ b/web/.yarnrc.yml @@ -1,9 +1,9 @@ npmScopes: fortawesome: npmAlwaysAuth: true - npmRegistryServer: "https://npm.fontawesome.com/" + npmRegistryServer: 'https://npm.fontawesome.com/' npmAuthToken: ECB95473-FBAF-463F-905C-C9ED4C00D519 awesome: npmAlwaysAuth: true - npmRegistryServer: "https://npm.fontawesome.com/" + npmRegistryServer: 'https://npm.fontawesome.com/' npmAuthToken: ECB95473-FBAF-463F-905C-C9ED4C00D519 diff --git a/web/astro.config.mjs b/web/astro.config.mjs index 496e7bc..b82a68d 100644 --- a/web/astro.config.mjs +++ b/web/astro.config.mjs @@ -25,12 +25,12 @@ const integrations = [svelte(), partytown(), sitemap()]; // Set the appropriate adapter, based on the deploy target const adapter = { - vercel: vercelAdapter, - netlify: netlifyAdapter, - cloudflare: cloudflareAdapter, - node: nodeAdapter({ - mode: 'standalone', - }), + vercel: vercelAdapter, + netlify: netlifyAdapter, + cloudflare: cloudflareAdapter, + node: nodeAdapter({ + mode: 'standalone', + }), }[deployTarget](); // Export Astro configuration diff --git a/web/eslint.config.js b/web/eslint.config.js new file mode 100644 index 0000000..f33aae6 --- /dev/null +++ b/web/eslint.config.js @@ -0,0 +1,80 @@ +import js from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import eslintPluginAstro from 'eslint-plugin-astro'; +import eslintPluginSvelte from 'eslint-plugin-svelte'; +import svelteParser from 'svelte-eslint-parser'; +import eslintConfigPrettier from 'eslint-config-prettier'; +import globals from 'globals'; + +export default [ + // Global ignores + { ignores: ['dist/', '.astro/', 'node_modules/', '.vercel/'] }, + + // Base JS config + js.configs.recommended, + + // TypeScript + ...tseslint.configs.recommended, + + // Astro + ...eslintPluginAstro.configs.recommended, + + // Svelte — with TypeScript parser for