From 1cf2a8811f853515f952780beb1b85f0055ce04d Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 6 Aug 2023 01:49:23 +0300 Subject: [PATCH] updated prettier config --- .prettierignore | 1 + .prettierrc.json | 11 ++++++++++- app/assets/js/app.js | 13 +++---------- app/assets/js/routes.js | 3 +-- app/index.html | 6 +----- app/partitial/header.html | 18 +++++------------- app/partitial/menu.html | 27 ++++++++------------------- pages/about.html | 3 +-- pages/games.html | 4 ++-- pages/personal.html | 5 +---- pages/rer2.html | 31 +++++++++---------------------- 11 files changed, 42 insertions(+), 80 deletions(-) diff --git a/.prettierignore b/.prettierignore index a3b56d0..eef0fe3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,3 +4,4 @@ app/assets/js/bootstrap* package.json package-lock.json server/ +README.md diff --git a/.prettierrc.json b/.prettierrc.json index 6377878..87437bd 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1 +1,10 @@ -{ "singleQuote": true } +{ + "printWidth": 100, + "bracketSpacing": true, + "bracketSameLine": true, + "semi": true, + "singleQuote": true, + "arrowParens": "always", + "htmlWhitespaceSensitivity": "strict", + "endOfLine": "lf" +} diff --git a/app/assets/js/app.js b/app/assets/js/app.js index 0bf395d..e13bc26 100644 --- a/app/assets/js/app.js +++ b/app/assets/js/app.js @@ -12,19 +12,14 @@ window.SERVER_HOST = SERVER_HOST; window.onload = function () { let app = document.documentElement; - if ( - window.matchMedia && - window.matchMedia('(prefers-color-scheme: dark)').matches - ) { + if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { switch_theme('dark'); } else { switch_theme('light'); } // theme switcher - document - .getElementById('app_theme_switcher') - .addEventListener('click', switch_theme, false); + document.getElementById('app_theme_switcher').addEventListener('click', switch_theme, false); // routes handler window.addEventListener('hashchange', location_handler); @@ -60,9 +55,7 @@ const location_handler = async () => { const html = await fetch(route.template).then((response) => response.text()); document.getElementById('content').innerHTML = html; document.title = route.title; - document - .querySelector('meta[name="description"]') - .setAttribute('content', route.description); + document.querySelector('meta[name="description"]').setAttribute('content', route.description); if (route.script) { let script = document.getElementById('content').querySelector('script'); diff --git a/app/assets/js/routes.js b/app/assets/js/routes.js index 268efd2..eba64b3 100644 --- a/app/assets/js/routes.js +++ b/app/assets/js/routes.js @@ -32,8 +32,7 @@ export const routes = { }, rer2: { template: '/pages/rer2.html', - title: - 'RE: Revelation 2 — Статус ежемесячных событий «Вторжение огромных тварей»', + title: 'RE: Revelation 2 — Статус ежемесячных событий «Вторжение огромных тварей»', description: '...', script: true, }, diff --git a/app/index.html b/app/index.html index b2d6423..feaa697 100644 --- a/app/index.html +++ b/app/index.html @@ -6,11 +6,7 @@ a2s - +