From 7745dba5f939b2b57dd98db3f83ce5050e1860b2 Mon Sep 17 00:00:00 2001 From: RaviAnand Mohabir Date: Fri, 21 May 2021 15:13:23 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Format=20and=20lint=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/postcss.config.cjs | 25 +++++++++++---------- app/src/app.html | 18 +++++++-------- app/src/routes/index.svelte | 5 ++++- app/svelte.config.js | 24 ++++++++++---------- app/tailwind.config.cjs | 44 ++++++++++++++++++------------------- app/tsconfig.json | 44 ++++++++++++++++++------------------- 6 files changed, 82 insertions(+), 78 deletions(-) diff --git a/app/postcss.config.cjs b/app/postcss.config.cjs index 7093fb1..ce4f583 100644 --- a/app/postcss.config.cjs +++ b/app/postcss.config.cjs @@ -6,17 +6,18 @@ const mode = process.env.NODE_ENV; const dev = mode === "development"; module.exports = { - plugins: [ - // Some plugins, like postcss-nested, need to run before Tailwind - - tailwindcss, - - // But others, like autoprefixer, need to run after + plugins: [ + // Some plugins, like postcss-nested, need to run before Tailwind - autoprefixer, - - !dev && cssnano({ - preset: "default", - }), - ], + tailwindcss, + + // But others, like autoprefixer, need to run after + + autoprefixer, + + !dev && + cssnano({ + preset: "default", + }), + ], }; diff --git a/app/src/app.html b/app/src/app.html index 245305c..817b808 100644 --- a/app/src/app.html +++ b/app/src/app.html @@ -1,12 +1,12 @@ - - - - - %svelte.head% - - -
%svelte.body%
- + + + + + %svelte.head% + + +
%svelte.body%
+ diff --git a/app/src/routes/index.svelte b/app/src/routes/index.svelte index 610459a..70edf03 100644 --- a/app/src/routes/index.svelte +++ b/app/src/routes/index.svelte @@ -1,2 +1,5 @@

Welcome to SvelteKit

-

Visit kit.svelte.dev to read the documentation

+

+ Visit kit.svelte.dev to read the + documentation +

diff --git a/app/svelte.config.js b/app/svelte.config.js index 71f5aa4..36501b3 100644 --- a/app/svelte.config.js +++ b/app/svelte.config.js @@ -1,19 +1,19 @@ -import preprocess from 'svelte-preprocess'; +import preprocess from "svelte-preprocess"; /** @type {import('@sveltejs/kit').Config} */ const config = { - // Consult https://github.com/sveltejs/svelte-preprocess - // for more information about preprocessors - preprocess: [ - preprocess({ - postcss: true - }), - ], + // Consult https://github.com/sveltejs/svelte-preprocess + // for more information about preprocessors + preprocess: [ + preprocess({ + postcss: true, + }), + ], - kit: { - // hydrate the
element in src/app.html - target: '#svelte' - } + kit: { + // hydrate the
element in src/app.html + target: "#svelte", + }, }; export default config; diff --git a/app/tailwind.config.cjs b/app/tailwind.config.cjs index 239aeca..2c79025 100644 --- a/app/tailwind.config.cjs +++ b/app/tailwind.config.cjs @@ -1,26 +1,26 @@ const { tailwindExtractor } = require("tailwindcss/lib/lib/purgeUnusedStyles"); module.exports = { - mode: "aot", - purge: { - content: [ - "./src/**/*.{html,js,svelte,ts}", - ], - options: { - defaultExtractor: (content) => [ - // If this stops working, please open an issue at https://github.com/svelte-add/tailwindcss/issues rather than bothering Tailwind Labs about it - ...tailwindExtractor(content), - // Match Svelte class: directives (https://github.com/tailwindlabs/tailwindcss/discussions/1731) - ...[...content.matchAll(/(?:class:)*([\w\d-/:%.]+)/gm)].map(([_match, group, ..._rest]) => group), - ], - }, - safelist: [/^svelte-[\d\w]+$/], - }, - theme: { - extend: {}, - }, - variants: { - extend: {}, - }, - plugins: [], + mode: "aot", + purge: { + content: ["./src/**/*.{html,js,svelte,ts}"], + options: { + defaultExtractor: (content) => [ + // If this stops working, please open an issue at https://github.com/svelte-add/tailwindcss/issues rather than bothering Tailwind Labs about it + ...tailwindExtractor(content), + // Match Svelte class: directives (https://github.com/tailwindlabs/tailwindcss/discussions/1731) + ...[...content.matchAll(/(?:class:)*([\w\d-/:%.]+)/gm)].map( + ([_match, group, ..._rest]) => group, + ), + ], + }, + safelist: [/^svelte-[\d\w]+$/], + }, + theme: { + extend: {}, + }, + variants: { + extend: {}, + }, + plugins: [], }; diff --git a/app/tsconfig.json b/app/tsconfig.json index d826f6e..51e5d71 100644 --- a/app/tsconfig.json +++ b/app/tsconfig.json @@ -1,30 +1,30 @@ { - "compilerOptions": { - "moduleResolution": "node", - "module": "es2020", - "lib": ["es2020"], - "target": "es2019", - /** + "compilerOptions": { + "moduleResolution": "node", + "module": "es2020", + "lib": ["es2020"], + "target": "es2019", + /** svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript to enforce using \`import type\` instead of \`import\` for Types. */ - "importsNotUsedAsValues": "error", - "isolatedModules": true, - "resolveJsonModule": true, - /** + "importsNotUsedAsValues": "error", + "isolatedModules": true, + "resolveJsonModule": true, + /** To have warnings/errors of the Svelte compiler at the correct position, enable source maps by default. */ - "sourceMap": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "baseUrl": ".", - "allowJs": true, - "checkJs": true, - "paths": { - "$lib/*": ["src/lib/*"] - } - }, - "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"] + "sourceMap": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "baseUrl": ".", + "allowJs": true, + "checkJs": true, + "paths": { + "$lib/*": ["src/lib/*"] + } + }, + "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"] }