Skip to content

Commit 77afd57

Browse files
committed
refactor: change eslint & prettier configs
1 parent 197b78b commit 77afd57

File tree

59 files changed

+245
-402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+245
-402
lines changed

apps/calculator-app/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"preview": "astro preview",
1010
"build": "pnpm check && astro build",
1111
"lint": "eslint --fix src/**/*.{astro,ts}",
12-
"format": "prettier --write src/**/*.{astro,ts}",
13-
"check": "astro check --tsconfig tsconfig.json"
12+
"check": "astro check --tsconfig tsconfig.json",
13+
"format": "prettier --write src/**/*.{astro,ts,css}"
1414
},
1515
"engines": {
1616
"node": ">=20",
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<article class="rounded-xl bg-screen px-8 py-6">
1+
<article class="bg-screen rounded-xl px-8 py-6">
22
<input
3-
id="input-display"
4-
class="fix-color w-full overflow-x-auto bg-transparent text-right text-5xl leading-none text-primary focus:outline-none"
53
readonly
4+
id="input-display"
5+
class="fix-color text-primary w-full overflow-x-auto bg-transparent text-right text-5xl leading-none focus:outline-none"
66
/>
77
</article>

apps/calculator-app/src/components/Header.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import ThemeSwitch from '@/components/ThemeSwitch.astro'
33
---
44

55
<header class="grid w-full grid-cols-[repeat(2,max-content)] items-center justify-between">
6-
<h1 class="fix-color text-4xl text-primary">calc</h1>
6+
<h1 class="fix-color text-primary text-4xl">calc</h1>
77
<ThemeSwitch />
88
</header>

apps/calculator-app/src/components/Key.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const { id, value, variant = 'primary' } = Astro.props
1212
<button
1313
id={`key-${id}`}
1414
class:list={[
15-
'relative grid h-16 w-full select-none place-items-center rounded-lg border-b-4 border-key-primary-dark bg-key-primary-light text-3xl/none font-bold active:h-[60px] active:translate-y-[0.25rem] active:border-b-2',
15+
'border-key-primary-dark bg-key-primary-light relative grid h-16 w-full select-none place-items-center rounded-lg border-b-4 text-3xl/none font-bold active:h-[60px] active:translate-y-[0.25rem] active:border-b-2',
1616
{
1717
[`border-key-${variant}-dark bg-key-${variant}-light text-xl/none text-white`]: variant !== 'primary',
1818
},

apps/calculator-app/src/components/Keypad.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Key from '@/components/Key.astro'
33
import { keyList } from '@/scripts/consts.ts'
44
---
55

6-
<section class="w-full rounded-xl bg-keypad p-8">
6+
<section class="bg-keypad w-full rounded-xl p-8">
77
<article class="mb-4 grid grid-cols-[repeat(4,4rem)] gap-4">
88
{
99
keyList.map(({ key, code }) =>
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
1-
<article class="fix-color select-none text-sm uppercase text-primary">
1+
<article class="fix-color text-primary select-none text-sm uppercase">
22
<div class="ml-auto w-max *:cursor-pointer *:px-3">
33
<label for="step-1">1</label>
44
<label for="step-2">2</label>
55
<label for="step-3">3</label>
66
</div>
77
<div class="flex content-center items-center gap-x-6">
88
<span class="mt-1.5 leading-none">theme</span>
9-
<div class="relative grid h-8 w-[100px] grid-cols-3 rounded-full bg-keypad">
10-
<input type="radio" id="step-1" name="switch-step" value="1" class="hidden cursor-pointer" />
11-
<label aria-label="Step 1" for="step-1" class="cursor-pointer"></label>
9+
<div class="bg-keypad relative grid h-8 w-[100px] grid-cols-3 rounded-full">
10+
<input type="radio" id="switch-theme-1" name="switch-theme" value="1" class="hidden cursor-pointer" />
11+
<label aria-label="Step 1" for="switch-theme-1" class="cursor-pointer"></label>
1212

13-
<input type="radio" id="step-2" name="switch-step" value="2" class="hidden cursor-pointer" />
14-
<label aria-label="Step 2" for="step-2" class="cursor-pointer"></label>
13+
<input type="radio" id="switch-theme-2" name="switch-theme" value="2" class="hidden cursor-pointer" />
14+
<label aria-label="Step 2" for="switch-theme-2" class="cursor-pointer"></label>
1515

16-
<input type="radio" id="step-3" name="switch-step" value="3" class="hidden cursor-pointer" />
17-
<label aria-label="Step 3" for="step-3" class="cursor-pointer"></label>
16+
<input type="radio" id="switch-theme-3" name="switch-theme" value="3" class="hidden cursor-pointer" />
17+
<label aria-label="Step 3" for="switch-theme-3" class="cursor-pointer"></label>
1818

19-
<span id="selector" class="absolute left-0 transition-[left] duration-300 ease-in-out ml-1.5 mt-1.5 h-5 w-5 rounded-full bg-key-tertiary-light"></span>
19+
<span
20+
id="selector"
21+
class="bg-key-tertiary-light absolute left-0 ml-1.5 mt-1.5 h-5 w-5 rounded-full transition-[left] duration-300 ease-in-out"
22+
></span>
2023
</div>
2124
</div>
2225
</article>
2326

2427
<style>
25-
#step-1:checked ~ #selector {
28+
#switch-theme-1:checked ~ #selector {
2629
left: 0;
2730
}
2831

29-
#step-2:checked ~ #selector {
32+
#switch-theme-2:checked ~ #selector {
3033
left: 33%;
3134
}
3235

33-
#step-3:checked ~ #selector {
36+
#switch-theme-3:checked ~ #selector {
3437
left: 68%;
3538
}
3639
</style>

apps/calculator-app/src/layouts/Layout.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import '@/styles/app.css'
1414
<script src="@/scripts/events.ts"></script>
1515
</head>
1616

17-
<body class="theme-1 grid min-h-screen content-center items-center gap-y-4 bg-main font-league-spartan">
17+
<body class="theme-1 bg-main font-league-spartan grid min-h-screen content-center items-center gap-y-4">
1818
<slot />
1919
</body>
2020
</html>

apps/calculator-app/src/pages/index.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ import Atributtion from 'shared/components/Atributtion.astro'
1313
<Display />
1414
<Keypad />
1515
</Container>
16-
<Atributtion class="fix-color mx-auto text-center text-sm text-primary" />
16+
<Atributtion class="fix-color text-primary mx-auto text-center text-sm" />
1717
</Layout>

apps/calculator-app/src/scripts/calculatorActions.ts

-72
Original file line numberDiff line numberDiff line change
@@ -113,78 +113,6 @@ export function updateInputDisplay(value: string): void {
113113
}
114114
}
115115

116-
// export function updateInputDisplay (value: string): void {
117-
// const isDigit = !Number.isNaN(Number(value))
118-
119-
// if ($inputDisplay != null) {
120-
// switch (value) {
121-
// case 'NumpadMultiply':
122-
// case 'KeyX':
123-
// case 'X':
124-
// case 'x':
125-
// case '*':
126-
// updateOperation($inputDisplay, '*')
127-
// break
128-
// case 'NumpadDivide':
129-
// case '/':
130-
// updateOperation($inputDisplay, '/')
131-
// break
132-
// case 'NumpadAdd':
133-
// case '+':
134-
// updateOperation($inputDisplay, '+')
135-
// break
136-
// case 'NumpadSubtract':
137-
// case '-':
138-
// updateOperation($inputDisplay, '-')
139-
// break
140-
// case 'NumpadDecimal':
141-
// case '.':
142-
// updateValueWithPoint($inputDisplay)
143-
// break
144-
// case 'Backspace':
145-
// $inputDisplay.value = $inputDisplay.value.slice(0, -1)
146-
// break
147-
// case 'Delete':
148-
// $inputDisplay.value = ''
149-
// isOperationUsed = false
150-
// break
151-
// case 'Enter':
152-
// isOperationUsed = false
153-
154-
// if ($inputDisplay.value === '') {
155-
// $inputDisplay.value = '0'
156-
// return
157-
// }
158-
159-
// $inputDisplay.value = getResult($inputDisplay)
160-
// break
161-
// default:
162-
// if (isDigit) {
163-
// const lastValue = getLastNumber($inputDisplay.value)
164-
// $inputDisplay.value = lastValue === '0' ? $inputDisplay.value.slice(0, -1) + value : $inputDisplay.value + value
165-
// isOperationUsed = false
166-
// }
167-
// }
168-
169-
// $inputDisplay.scrollLeft = $inputDisplay.scrollWidth
170-
// }
171-
// }
172-
173-
// export function updateKeyActive (event: KeyboardEvent, classListMethod: 'add' | 'remove'): void {
174-
// try {
175-
// for (const { key, code } of keypadList) {
176-
// const codeExists = Array.isArray(code)
177-
178-
// if (key === event.key || (codeExists && code.includes(event.code))) {
179-
// const id = `#key-${codeExists ? code[0] : key}`
180-
// $(id)?.classList[classListMethod]('active')
181-
// }
182-
// }
183-
// } catch (error) {
184-
// console.error(error)
185-
// }
186-
// }
187-
188116
export function updateKeyActive(event: KeyboardEvent, classListMethod: 'add' | 'remove'): void {
189117
try {
190118
const keyItem = keypadList.find(({ key, code }) => matchesKeyOrCode(event, key, code))

apps/calculator-app/src/scripts/consts.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const KEY_SELECTOR = '[id^="key-"]'
22
export const NUMBERS_SEPARATE_REGEX = /[+\-*/]/
33
export const THEME_STORAGE = 'calculator-app-theme'
4-
export const INPUT_SWITCH_SELECTOR = 'input[name="switch-step"]'
4+
export const INPUT_SWITCH_SELECTOR = 'input[name="switch-theme"]'
55

66
export const keyList = [
77
{ key: '7' },
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { $, $$ } from 'shared/utils/dom.ts'
22
import { KEY_SELECTOR } from '@/scripts/consts.ts'
33

4-
export const inputStep1 = $<HTMLInputElement>('#step-1')
5-
export const inputStep2 = $<HTMLInputElement>('#step-2')
6-
export const inputStep3 = $<HTMLInputElement>('#step-3')
74
export const $keyButtons = $$<HTMLButtonElement>(KEY_SELECTOR)
5+
export const inputStep1 = $<HTMLInputElement>('#switch-theme-1')
6+
export const inputStep2 = $<HTMLInputElement>('#switch-theme-2')
7+
export const inputStep3 = $<HTMLInputElement>('#switch-theme-3')
88
export const $inputDisplay = $<HTMLInputElement>('#input-display')

apps/calculator-app/src/styles/app.css

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "shared/styles/tailwind";
1+
@import 'shared/styles/tailwind';
22
@source "safelist.txt";
33

44
:root {
@@ -21,7 +21,6 @@
2121

2222
--very-dark-grayish-blue: hsl(221, 14%, 31%);
2323

24-
2524
/* ------------------------------------------------- */
2625
/* -------------------- THEME 2 -------------------- */
2726
/* ------------------------------------------------- */
@@ -41,7 +40,6 @@
4140

4241
--very-dark-grayish-yellow: hsl(60, 10%, 19%);
4342

44-
4543
/* ------------------------------------------------- */
4644
/* -------------------- THEME 3 -------------------- */
4745
/* ------------------------------------------------- */
@@ -70,7 +68,7 @@
7068
--breakpoint-lg: 1024px;
7169
--breakpoint-xl: 1280px;
7270

73-
--font-league-spartan: "League Spartan", sans-serif;
71+
--font-league-spartan: 'League Spartan', sans-serif;
7472

7573
--color-main: var(--very-dark-desaturated-blue-main);
7674
--color-keypad: var(--very-dark-desaturated-blue-keypad);
@@ -148,9 +146,9 @@ body.theme-3 {
148146
}
149147

150148
@font-face {
151-
font-family: "League Spartan";
149+
font-family: 'League Spartan';
152150
font-style: normal;
153151
font-weight: 700;
154152
font-display: swap;
155-
src: url("/frontendmentor/calculator-app/fonts/league-spartan-700.woff2") format("woff2");
156-
}
153+
src: url('/frontendmentor/calculator-app/fonts/league-spartan-700.woff2') format('woff2');
154+
}

apps/fylo-landing-page-with-two-column-layout/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"preview": "astro preview",
1010
"build": "pnpm check && astro build",
1111
"lint": "eslint --fix src/**/*.{astro,ts}",
12-
"format": "prettier --write src/**/*.{astro,ts}",
13-
"check": "astro check --tsconfig tsconfig.json"
12+
"check": "astro check --tsconfig tsconfig.json",
13+
"format": "prettier --write src/**/*.{astro,ts,css}"
1414
},
1515
"engines": {
1616
"node": ">=20",

apps/fylo-landing-page-with-two-column-layout/src/components/Button.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { class: extraClass } = Astro.props
99
<button
1010
type="submit"
1111
class:list={[
12-
'h-12 w-full rounded cursor-pointer bg-accent-blue px-4 py-2 text-sm font-bold text-white shadow-lg outline-none hover:bg-accent-green active:border-0',
12+
'bg-accent-blue hover:bg-accent-green h-12 w-full cursor-pointer rounded px-4 py-2 text-sm font-bold text-white shadow-lg outline-none active:border-0',
1313
extraClass,
1414
]}
1515
>

apps/fylo-landing-page-with-two-column-layout/src/components/FirstContact.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Button from '@/components/Button.astro'
99
class="container flex flex-wrap-reverse items-center justify-center pb-12 pt-0 lg:flex-wrap lg:pb-0"
1010
>
1111
<div class="w-full text-center lg:w-1/2 lg:text-left">
12-
<h2 class="py-2 font-raleway text-3xl font-bold [text-wrap:balance] lg:text-5xl">
12+
<h2 class="font-raleway py-2 text-3xl font-bold [text-wrap:balance] lg:text-5xl">
1313
All your files in one secure location, accesible anywhere.
1414
</h2>
1515

apps/fylo-landing-page-with-two-column-layout/src/components/SecondContact.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Button from '@/components/Button.astro'
55
<section id="second-contact" class="bg-primary-desa py-16 lg:py-32">
66
<div class="container flex flex-wrap items-start justify-center text-center text-white lg:text-left">
77
<div class="w-full lg:w-1/2">
8-
<h3 class="w-full font-raleway text-3xl font-bold lg:text-4xl">Get early access today</h3>
8+
<h3 class="font-raleway w-full text-3xl font-bold lg:text-4xl">Get early access today</h3>
99

1010
<p class="mx-auto py-8 sm:w-3/4 lg:mx-0 lg:w-4/5 lg:pt-6 lg:text-lg">
1111
It only takes a minute to sign up and our free starter tier is extremely generous. If you have any questions,
@@ -19,7 +19,7 @@ import Button from '@/components/Button.astro'
1919
type="email"
2020
aria-label="Enter your email"
2121
placeholder="[email protected]"
22-
class="mx-auto h-12 w-full rounded bg-white border border-solid border-black pl-4 text-sm text-black outline-none sm:w-3/4 lg:w-full lg:pl-6"
22+
class="mx-auto h-12 w-full rounded border border-solid border-black bg-white pl-4 text-sm text-black outline-none sm:w-3/4 lg:w-full lg:pl-6"
2323
required
2424
/>
2525

apps/fylo-landing-page-with-two-column-layout/src/components/Testimonial.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const imageSrc = '/frontendmentor/fylo-landing-page-with-two-column-layout/image
2121
</p>
2222

2323
<div class="my-16 lg:my-4">
24-
<Link to="#" class="border-b-2 border-accent-green pb-1 text-lg text-accent-green">
24+
<Link to="#" class="border-accent-green text-accent-green border-b-2 pb-1 text-lg">
2525
<span>See how Fylo works</span>
2626
<Icon name="icon-arrow" width={18} height={18} class="ml-0.5 inline" />
2727
</Link>

apps/fylo-landing-page-with-two-column-layout/src/layouts/Layout.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import '@/styles/app.css'
99
<MetaTags slug="fylo-landing-page-with-two-column-layout" themeColor="#070439" />
1010
</head>
1111

12-
<body class="min-h-screen font-opensans">
12+
<body class="font-opensans min-h-screen">
1313
<slot />
1414
</body>
1515
</html>

apps/fylo-landing-page-with-two-column-layout/src/pages/index.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Footer from '@/components/Footer.astro'
1313
<FirstContact />
1414

1515
<div class="mt-16 h-16 lg:mt-32 lg:h-32">
16-
<svg class="h-full w-full fill-current text-neutral-blue" viewBox="0 0 500 150" preserveAspectRatio="none">
16+
<svg class="text-neutral-blue h-full w-full fill-current" viewBox="0 0 500 150" preserveAspectRatio="none">
1717
<path d="M-8.17,139.63 C136.29,51.80 318.00,33.05 526.24,155.42 L547.11,172.20 L-29.06,170.22 Z"></path>
1818
</svg>
1919
</div>

0 commit comments

Comments
 (0)