Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
SeryiBaran committed May 6, 2023
1 parent ac33fed commit 98957b3
Show file tree
Hide file tree
Showing 12 changed files with 120 additions and 51 deletions.
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"extends": ["@antfu", "plugin:tailwindcss/recommended"],
"extends": ["@antfu", "prettier", "plugin:tailwindcss/recommended"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"antfu/if-newline": "off",
"no-console": "off",
"tailwindcss/classnames-order": "error",
"tailwindcss/no-custom-classname": "off"
}
Expand Down
7 changes: 0 additions & 7 deletions .prettierignore

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 80,
"semi": false,
"singleQuote": true
}
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"ZixuanChen.vitest-explorer",
"bradlc.vscode-tailwindcss",
"vue.volar",
"vue.vscode-typescript-vue-plugin",
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig"
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"gruntfuggly.todo-tree"
]
}
6 changes: 2 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.formatOnSave": false,
"editor.formatOnSave": true,
"css.lint.unknownAtRules": "ignore",
"i18n-ally.dirStructure": "file",
"i18n-ally.localesPaths": [
"src/i18n"
],
"i18n-ally.localesPaths": ["src/i18n"],
"i18n-ally.keystyle": "nested",
"i18n-ally.sourceLanguage": "ru"
}
63 changes: 63 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@
"@vue/test-utils": "^2.3.2",
"autoprefixer": "^10.4.14",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-tailwindcss": "^3.11.0",
"happy-dom": "^9.8.0",
"lint-staged": "^13.2.1",
"postcss": "^8.4.22",
"prettier": "^2.8.8",
"simple-git-hooks": "^2.8.1",
"tailwindcss": "^3.3.1",
"taze": "^0.9.1",
Expand Down
32 changes: 21 additions & 11 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,46 @@ function toggleLocale() {
if (!(indexOfCurrentLocale < availableLocales.length - 1))
localeStore.value = availableLocales[0]
else
localeStore.value = availableLocales[indexOfCurrentLocale + 1]
else localeStore.value = availableLocales[indexOfCurrentLocale + 1]
}
</script>

<template>
<div class="m-auto flex min-h-[100vh] max-w-2xl flex-col items-center justify-center p-4 text-center font-sans">
<div
class="m-auto flex min-h-[100vh] max-w-2xl flex-col items-center justify-center p-4 text-center font-sans"
>
<header class="flex flex-wrap items-center justify-center gap-4">
<h1>
Tailvue
</h1>
<h1>Tailvue</h1>
</header>
<main class="flex flex-col items-center gap-4">
<section>
<p data-testId="aboutParagraph">
{{ $t("about") }}
{{ $t('about') }}
</p>
</section>

<div class="flex gap-4">
<a href="https://github.com/SeryiBaran/tailvue-starter" target="_blank" class="btn icon-button">
<a
href="https://github.com/SeryiBaran/tailvue-starter"
target="_blank"
class="btn icon-button"
>
<IconMdiGithub class="icon" />
</a>

<button class="btn icon-button" data-testId="toggleDarkBtn" @click="toggleDark()">
<button
class="btn icon-button"
data-testId="toggleDarkBtn"
@click="toggleDark()"
>
<IconMdiThemeLightDark class="icon" />
</button>

<button data-testId="toggleLocaleBtn" class="btn icon-button" @click="toggleLocale()">
<button
data-testId="toggleLocaleBtn"
class="btn icon-button"
@click="toggleLocale()"
>
<IconMdiTranslate class="icon" />
</button>
</div>
Expand Down
14 changes: 11 additions & 3 deletions src/__tests__/i18n.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ describe('I18n', async () => {
},
})

const locales = Object.keys(config.messages) as Array<keyof typeof config.messages>
const locales = Object.keys(config.messages) as Array<
keyof typeof config.messages
>

for (let index = 0; index < locales.length + 1; index++) {
if (index !== 0)
await wrapper.find('button[data-testId="toggleLocaleBtn"]').trigger('click')
await wrapper
.find('button[data-testId="toggleLocaleBtn"]')
.trigger('click')

expect(wrapper.find('p[data-testId="aboutParagraph"]').text()).toBe(config.messages[index > locales.length - 1 ? locales[0] : locales[index]].about)
expect(wrapper.find('p[data-testId="aboutParagraph"]').text()).toBe(
config.messages[
index > locales.length - 1 ? locales[0] : locales[index]
].about
)
}
})
})
5 changes: 1 addition & 4 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

module.exports = {
darkMode: 'class',
content: [
'./index.html',
'./src/**/*.{vue,js,ts,jsx,tsx}',
],
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
theme: {
extend: {
fontFamily: {
Expand Down
20 changes: 4 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
"baseUrl": ".",
"module": "ESNext",
"target": "es2016",
"lib": [
"DOM",
"ESNext"
],
"lib": ["DOM", "ESNext"],
"strict": true,
"jsx": "preserve",
"esModuleInterop": true,
Expand All @@ -18,18 +15,9 @@
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": [
"./src/*"
]
"@/*": ["./src/*"]
}
},
"include": [
"env.d.ts",
"./src/**/*"
],
"exclude": [
"dist",
"node_modules",
"*.cjs"
]
"include": ["env.d.ts", "./src/**/*"],
"exclude": ["dist", "node_modules", "*.cjs"]
}
5 changes: 1 addition & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export default defineConfig({
'@/': `${path.resolve(__dirname, 'src')}/`,
},
},
plugins: [
Vue(),
Icons({ compiler: 'vue3' }),
],
plugins: [Vue(), Icons({ compiler: 'vue3' })],
test: {
environment: 'happy-dom',
},
Expand Down

0 comments on commit 98957b3

Please sign in to comment.