From dccb94a792b68240e40bba5857d29fe6fbcd41bd Mon Sep 17 00:00:00 2001 From: Max Nuding Date: Sun, 19 Mar 2023 17:17:04 +0100 Subject: [PATCH] Clean up initial state --- .editorconfig | 5 ++++ .eslintrc.cjs | 36 ++++++++++++------------- .gitignore | 47 +++++++++++++++++++++++++++++++- .nova/Configuration.json | 7 +++++ .prettierrc | 15 ++++++----- package.json | 58 ++++++++++++++++++++-------------------- src/app.d.ts | 12 ++++----- src/app.html | 18 ++++++------- svelte.config.js | 18 ++++++------- tsconfig.json | 30 ++++++++++----------- vite.config.ts | 2 +- 11 files changed, 153 insertions(+), 95 deletions(-) create mode 100644 .editorconfig create mode 100644 .nova/Configuration.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0d7fefe --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +root = true + +[*.{svelte, ts, cjs, json}] +indent_style = space +indent_size = 4 \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3ccf435..eaf19f5 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,20 +1,20 @@ module.exports = { - root: true, - parser: '@typescript-eslint/parser', - extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], - plugins: ['svelte3', '@typescript-eslint'], - ignorePatterns: ['*.cjs'], - overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], - settings: { - 'svelte3/typescript': () => require('typescript') - }, - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020 - }, - env: { - browser: true, - es2017: true, - node: true - } + root: true, + parser: '@typescript-eslint/parser', + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], + plugins: ['svelte3', '@typescript-eslint'], + ignorePatterns: ['*.cjs'], + overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], + settings: { + 'svelte3/typescript': () => require('typescript') + }, + parserOptions: { + sourceType: 'module', + ecmaVersion: 2020 + }, + env: { + browser: true, + es2017: true, + node: true + } }; diff --git a/.gitignore b/.gitignore index 6635cf5..13d64f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -.DS_Store node_modules /build /.svelte-kit @@ -8,3 +7,49 @@ node_modules !.env.example vite.config.js.timestamp-* vite.config.ts.timestamp-* + + +# Created by https://www.toptal.com/developers/gitignore/api/svelte,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=svelte,macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Svelte ### +# gitignore template for the SvelteKit, frontend web component framework +# website: https://kit.svelte.dev/ + +.svelte-kit/ +package + +# End of https://www.toptal.com/developers/gitignore/api/svelte,macos diff --git a/.nova/Configuration.json b/.nova/Configuration.json new file mode 100644 index 0000000..136f707 --- /dev/null +++ b/.nova/Configuration.json @@ -0,0 +1,7 @@ +{ + "apexskier.typescript.config.formatDocumentOnSave": "true", + "apexskier.typescript.config.isEnabledForJavascript": "Enable", + "apexskier.typescript.config.organizeImportsOnSave": "true", + "apexskier.typescript.config.userPreferences.quotePreference": "single", + "apexskier.typescript.config.userPreferences.useLabelDetailsInCompletionEntries": true +} diff --git a/.prettierrc b/.prettierrc index a77fdde..4146a05 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,9 +1,10 @@ { - "useTabs": true, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100, - "plugins": ["prettier-plugin-svelte"], - "pluginSearchDirs": ["."], - "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] + "useTabs": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "printWidth": 100, + "plugins": ["prettier-plugin-svelte"], + "pluginSearchDirs": ["."], + "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] } diff --git a/package.json b/package.json index 4ff8575..2043a1a 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,31 @@ { - "name": "moshing-mammut", - "version": "0.0.1", - "private": true, - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "lint": "prettier --plugin-search-dir . --check . && eslint .", - "format": "prettier --plugin-search-dir . --write ." - }, - "devDependencies": { - "@sveltejs/adapter-auto": "^2.0.0", - "@sveltejs/kit": "^1.5.0", - "@typescript-eslint/eslint-plugin": "^5.45.0", - "@typescript-eslint/parser": "^5.45.0", - "eslint": "^8.28.0", - "eslint-config-prettier": "^8.5.0", - "eslint-plugin-svelte3": "^4.0.0", - "prettier": "^2.8.0", - "prettier-plugin-svelte": "^2.8.1", - "svelte": "^3.54.0", - "svelte-check": "^3.0.1", - "tslib": "^2.4.1", - "typescript": "^4.9.3", - "vite": "^4.0.0" - }, - "type": "module" + "name": "moshing-mammut", + "version": "0.0.1", + "private": true, + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --plugin-search-dir . --check . && eslint .", + "format": "prettier --plugin-search-dir . --write ." + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^2.0.0", + "@sveltejs/kit": "^1.5.0", + "@typescript-eslint/eslint-plugin": "^5.45.0", + "@typescript-eslint/parser": "^5.45.0", + "eslint": "^8.28.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-svelte3": "^4.0.0", + "prettier": "^2.8.0", + "prettier-plugin-svelte": "^2.8.1", + "svelte": "^3.54.0", + "svelte-check": "^3.0.1", + "tslib": "^2.4.1", + "typescript": "^4.9.3", + "vite": "^4.0.0" + }, + "type": "module" } diff --git a/src/app.d.ts b/src/app.d.ts index f59b884..899c7e8 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -1,12 +1,12 @@ // See https://kit.svelte.dev/docs/types#app // for information about these interfaces declare global { - namespace App { - // interface Error {} - // interface Locals {} - // interface PageData {} - // interface Platform {} - } + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface Platform {} + } } export {}; diff --git a/src/app.html b/src/app.html index effe0d0..117bd02 100644 --- a/src/app.html +++ b/src/app.html @@ -1,12 +1,12 @@ - - - - - %sveltekit.head% - - -
%sveltekit.body%
- + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ diff --git a/svelte.config.js b/svelte.config.js index 1cf26a0..ecaf275 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -3,16 +3,16 @@ import { vitePreprocess } from '@sveltejs/kit/vite'; /** @type {import('@sveltejs/kit').Config} */ const config = { - // Consult https://kit.svelte.dev/docs/integrations#preprocessors - // for more information about preprocessors - preprocess: vitePreprocess(), + // Consult https://kit.svelte.dev/docs/integrations#preprocessors + // for more information about preprocessors + preprocess: vitePreprocess(), - kit: { - // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. - // If your environment is not supported or you settled on a specific environment, switch out the adapter. - // See https://kit.svelte.dev/docs/adapters for more information about adapters. - adapter: adapter() - } + kit: { + // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. + // If your environment is not supported or you settled on a specific environment, switch out the adapter. + // See https://kit.svelte.dev/docs/adapters for more information about adapters. + adapter: adapter() + } }; export default config; diff --git a/tsconfig.json b/tsconfig.json index 6ae0c8c..794b95b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,17 @@ { - "extends": "./.svelte-kit/tsconfig.json", - "compilerOptions": { - "allowJs": true, - "checkJs": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "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 + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "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.ts b/vite.config.ts index bbf8c7d..3406f32 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,5 +2,5 @@ import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; export default defineConfig({ - plugins: [sveltekit()] + plugins: [sveltekit()] });