koro

an event time scheduler
git clone https://tilde.team/~marisa/repo/koro.git
Log | Files | Refs | README | LICENSE

commit e7ac63ba4c86baaab18770df74b12f12ea905072
parent ee8dbe6ac8582354095ee5deda64c5c9da196e3b
Author: mokou <mokou@posteo.de>
Date:   Thu, 21 May 2020 02:27:19 +0200

chore: Lint with single quotes

Diffstat:
Mpackage.json | 2+-
Mpostcss.config.js | 2+-
Msrc/App.svelte | 10+++++-----
Msrc/components/DateTimeGrid.svelte | 26+++++++++++++-------------
Msrc/main.css | 20++++++++++----------
Msrc/main.js | 6+++---
Msrc/pages/Index.svelte | 50+++++++++++++++++++++++++-------------------------
Mtailwind.config.js | 4++--
Mwebpack.config.js | 36++++++++++++++++++------------------
9 files changed, 78 insertions(+), 78 deletions(-)

diff --git a/package.json b/package.json @@ -5,7 +5,7 @@ "scripts": { "build": "webpack", "start": "webpack-dev-server", - "lint": "prettier --write --no-semi ." + "lint": "prettier --write --no-semi --single-quote ." }, "dependencies": { "accessible-autocomplete": "^2.0.2", diff --git a/postcss.config.js b/postcss.config.js @@ -1,3 +1,3 @@ module.exports = { - plugins: [require("tailwindcss"), require("cssnano")], + plugins: [require('tailwindcss'), require('cssnano')], } diff --git a/src/App.svelte b/src/App.svelte @@ -1,14 +1,14 @@ <script> - import navaid from "navaid" - import Index from "./pages/Index.svelte" - import Event from "./pages/Event.svelte" + import navaid from 'navaid' + import Index from './pages/Index.svelte' + import Event from './pages/Event.svelte' export let router = navaid() let route let routeParams - router.on("/", setRoute(Index)) - router.on("/:id", setRoute(Event)) + router.on('/', setRoute(Index)) + router.on('/:id', setRoute(Event)) router.listen() diff --git a/src/components/DateTimeGrid.svelte b/src/components/DateTimeGrid.svelte @@ -1,6 +1,6 @@ <script> - import day from "dayjs" - import relativeTime from "dayjs/plugin/relativeTime" + import day from 'dayjs' + import relativeTime from 'dayjs/plugin/relativeTime' day.extend(relativeTime) export let startDate @@ -18,35 +18,35 @@ let first = start if (start.date() === day(startDate).date()) { day1 = day(startDate) - first = day1.add(30, "minutes").startOf("hour") + first = day1.add(30, 'minutes').startOf('hour') } else { day1 = start } datesDay1 = [first] let indexDay1 = first - while (indexDay1.add(30, "minutes").date() === day1.date()) { - indexDay1 = indexDay1.add(30, "minutes") + while (indexDay1.add(30, 'minutes').date() === day1.date()) { + indexDay1 = indexDay1.add(30, 'minutes') datesDay1.push(indexDay1) } - day2 = day1.add(1, "days").startOf("day") + day2 = day1.add(1, 'days').startOf('day') datesDay2 = [day2] let indexDay2 = day2 - while (indexDay2.add(30, "minutes").date() === day2.date()) { - indexDay2 = indexDay2.add(30, "minutes") + while (indexDay2.add(30, 'minutes').date() === day2.date()) { + indexDay2 = indexDay2.add(30, 'minutes') datesDay2.push(indexDay2) } - day3 = day2.add(1, "days").startOf("day") + day3 = day2.add(1, 'days').startOf('day') datesDay3 = [day3] let indexDay3 = day3 - while (indexDay3.add(30, "minutes").date() === day3.date()) { - indexDay3 = indexDay3.add(30, "minutes") + while (indexDay3.add(30, 'minutes').date() === day3.date()) { + indexDay3 = indexDay3.add(30, 'minutes') datesDay3.push(indexDay3) } } function previousDay() { if (day1.date() !== day(startDate).date()) { - initDays(day1.subtract(1, "day").startOf("day")) + initDays(day1.subtract(1, 'day').startOf('day')) } } @@ -62,7 +62,7 @@ } function nextDay() { - initDays(day1.add(1, "day").startOf("day")) + initDays(day1.add(1, 'day').startOf('day')) } </script> diff --git a/src/main.css b/src/main.css @@ -1,18 +1,18 @@ @font-face { - font-family: "Inter"; + font-family: 'Inter'; font-style: normal; font-weight: 400; - src: local("Inter Regular"), local("Inter-Regular"), - url("../fonts/Inter-Regular.woff2") format("woff2"), - /* Chrome 26+, Opera 23+, Firefox 39+ */ url("../fonts/Inter-Regular.woff") - format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + src: local('Inter Regular'), local('Inter-Regular'), + url('../fonts/Inter-Regular.woff2') format('woff2'), + /* Chrome 26+, Opera 23+, Firefox 39+ */ url('../fonts/Inter-Regular.woff') + format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } -@import "tailwindcss/base"; -@import "tailwindcss/components"; +@import 'tailwindcss/base'; +@import 'tailwindcss/components'; body { - font-family: "Inter"; + font-family: 'Inter'; } input { @@ -28,7 +28,7 @@ input { .btn { @apply px-3 py-2 font-bold bg-purple-600 text-white border-purple-600 rounded-sm; - font-family: "Inter"; + font-family: 'Inter'; } .btn:not(:disabled):active { @@ -75,4 +75,4 @@ input:focus { } } -@import "tailwindcss/utilities"; +@import 'tailwindcss/utilities'; diff --git a/src/main.js b/src/main.js @@ -1,10 +1,10 @@ -import App from "./App.svelte" -import "./main.css" +import App from './App.svelte' +import './main.css' const app = new App({ target: document.body, props: { - name: "world", + name: 'world', }, }) diff --git a/src/pages/Index.svelte b/src/pages/Index.svelte @@ -1,60 +1,60 @@ <script> - import PouchDB from "pouchdb-browser" - import autocomplete from "accessible-autocomplete" - import search from "fuzzysearch" - import { nanoid } from "nanoid" - import { onMount } from "svelte" - import DateTimeGrid from "../components/DateTimeGrid.svelte" + import PouchDB from 'pouchdb-browser' + import autocomplete from 'accessible-autocomplete' + import search from 'fuzzysearch' + import { nanoid } from 'nanoid' + import { onMount } from 'svelte' + import DateTimeGrid from '../components/DateTimeGrid.svelte' let submitting = false - let errorFlash = "" + let errorFlash = '' let durationInput = null let durationsList = [ - "15 minutes", - "30 minutes", - "45 minutes", - "1 hour", - "2 hours", - "3 hours", - "4 hours", - "5 hours", + '15 minutes', + '30 minutes', + '45 minutes', + '1 hour', + '2 hours', + '3 hours', + '4 hours', + '5 hours', ] let event = { _id: nanoid(), - name: "", - duration: "", + name: '', + duration: '', times: [], } async function submitForm() { - errorFlash = "" + errorFlash = '' submitting = true if (!event.name) { - errorFlash = "Please set a name for your event!" + errorFlash = 'Please set a name for your event!' submitting = false return } if (!event.duration) { - errorFlash = "Please set a duration for your event!" + errorFlash = 'Please set a duration for your event!' submitting = false return } if (!durationsList.includes(event.duration)) { console.log(event) - errorFlash = "The duration must be picked from the provided list!" + errorFlash = 'The duration must be picked from the provided list!' submitting = false return } if (event.times.length === 0) { - errorFlash = "Please pick at least one event time!" + errorFlash = 'Please pick at least one event time!' submitting = false return } - const db = new PouchDB("koro") + const db = new PouchDB('koro') try { const res = await db.put(event) console.log(res) @@ -71,8 +71,8 @@ onMount(() => { autocomplete({ - element: document.querySelector("#duration-mount"), - id: "duration", + element: document.querySelector('#duration-mount'), + id: 'duration', source: durationSource, confirmOnBlur: false, onConfirm: (opt) => { diff --git a/tailwind.config.js b/tailwind.config.js @@ -1,6 +1,6 @@ module.exports = { - purge: ["./src/**/*.svelte", "./src/**/*.js"], + purge: ['./src/**/*.svelte', './src/**/*.js'], variants: { - cursor: ["hover"], + cursor: ['hover'], }, } diff --git a/webpack.config.js b/webpack.config.js @@ -1,51 +1,51 @@ -const CssExtractPlugin = require("mini-css-extract-plugin") -const TerserWebpackPlugin = require("terser-webpack-plugin") -const path = require("path") +const CssExtractPlugin = require('mini-css-extract-plugin') +const TerserWebpackPlugin = require('terser-webpack-plugin') +const path = require('path') -const prod = process.env.NODE_ENV !== "development" +const prod = process.env.NODE_ENV !== 'development' module.exports = { - name: "bundle", + name: 'bundle', entry: { - main: "./src/main.js", + main: './src/main.js', }, output: { - filename: "[name].js", - path: path.resolve(process.cwd(), "public/build"), + filename: '[name].js', + path: path.resolve(process.cwd(), 'public/build'), }, - mode: prod ? "production" : "development", + mode: prod ? 'production' : 'development', devServer: { publicPath: '/build', - contentBase: path.join(process.cwd(), "public"), + contentBase: path.join(process.cwd(), 'public'), compress: true, port: 3000, - historyApiFallback: true + historyApiFallback: true, }, - devtool: !prod && "source-map", + devtool: !prod && 'source-map', optimization: prod && { minimizer: [new TerserWebpackPlugin({})], }, resolve: { alias: { - svelte: path.resolve("node_modules", "svelte"), + svelte: path.resolve('node_modules', 'svelte'), }, - extensions: [".mjs", ".js", ".svelte"], - mainFields: ["svelte", "browser", "module", "main"], + extensions: ['.mjs', '.js', '.svelte'], + mainFields: ['svelte', 'browser', 'module', 'main'], }, module: { rules: [ { test: /\.(html|svelte)$/, exclude: /node_modules/, - use: "svelte-loader", + use: 'svelte-loader', }, { test: /\.css$/, exclude: /node_modules/, use: [ { loader: CssExtractPlugin.loader }, - { loader: "css-loader", options: { url: false, importLoaders: 1 } }, - { loader: "postcss-loader" }, + { loader: 'css-loader', options: { url: false, importLoaders: 1 } }, + { loader: 'postcss-loader' }, ], }, ],