Skip to content

Commit

Permalink
ESLINT no código com yarn lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hermesalvesbr committed Nov 2, 2022
1 parent 9598b55 commit bdab36b
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 110 deletions.
46 changes: 46 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:vue/essential",
"google"
],
"parserOptions": {
"ecmaVersion": "latest",
"parser": "@typescript-eslint/parser",
"sourceType": "module"
},
"plugins": [
"vue",
"@typescript-eslint"
],
"rules": {
"max-len": 0,
"semi": [
2,
"never"
],
"object-curly-spacing": [
2,
"always"
],
"comma-dangle": [
"error",
"never"
],
"require-jsdoc": [
"error",
{
"require": {
"FunctionDeclaration": false,
"MethodDefinition": false,
"ClassDeclaration": false,
"ArrowFunctionExpression": false,
"FunctionExpression": false
}
}
]
}
}
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
"files.associations": {
"*.css": "postcss"
},
"editor.formatOnSave": false
"editor.formatOnSave": true,
"eslint.validate": [
"javascript",
"typescript"
]
}
2 changes: 1 addition & 1 deletion components/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ const { cover } = useAppConfig()
body {
@apply bg-primary-50
}
</style>
</style>
16 changes: 9 additions & 7 deletions components/AppLoadingBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<div class="nuxt-progress" :class="{
'nuxt-progress-failed': !data.canSucceed,
}" :style="{
width: `${data.percent}%`,
left: data.left,
height: `${props.height}px`,
opacity: data.show ? 1 : 0,
backgroundSize: `${(100 / data.percent) * 100}% auto`,
}" />
width: `${data.percent}%`,
left: data.left,
height: `${props.height}px`,
opacity: data.show ? 1 : 0,
backgroundSize: `${(100 / data.percent) * 100}% auto`,
}" />
</template>
<script setup>
import { useNuxtApp, onBeforeUnmount, reactive } from '#imports'
Expand Down Expand Up @@ -48,7 +48,9 @@ function clear() {
_timer = null
}
function start() {
if (data.show) { return }
if (data.show) {
return
}
clear()
data.percent = 0
data.canSucceed = true
Expand Down
2 changes: 1 addition & 1 deletion components/AppNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
<script lang="ts" setup>
const { navigation } = useContent()
const appConfig = useAppConfig()
</script>
</script>
2 changes: 1 addition & 1 deletion components/ColorModeSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
<script setup lang="ts">
const colorMode = useColorMode()
const onClick = () => (colorMode.value === 'light' ? (colorMode.preference = 'dark') : (colorMode.preference = 'light'))
</script>
</script>
2 changes: 1 addition & 1 deletion components/content/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<!-- https://content.nuxtjs.org/api/components/content-slot -->
<ContentSlot :use="$slots.default" unwrap="p" />
</div>
</template>
</template>
217 changes: 126 additions & 91 deletions components/content/RegisterInto.vue
Original file line number Diff line number Diff line change
@@ -1,107 +1,142 @@
<template>
<div>
<div class="sm:mx-auto sm:w-full sm:max-w-md">
<img class="mx-auto h-12 w-auto" src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=600"
alt="Your Company" />
<h2 class="mt-6 text-center text-3xl font-bold tracking-tight text-gray-900">Sign in to your account</h2>
<p class="mt-2 text-center text-sm text-gray-600">
Or
{{ ' ' }}
<a href="#" class="font-medium text-indigo-600 hover:text-indigo-500">start your 14-day free trial</a>
</p>
</div>
<div>
<div class="sm:mx-auto sm:w-full sm:max-w-md">
<img
class="mx-auto h-12 w-auto"
src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=600"
alt="Your Company"
>
<h2 class="mt-6 text-center text-3xl font-bold tracking-tight text-gray-900">
Sign in to your account
</h2>
<p class="mt-2 text-center text-sm text-gray-600">
Or
{{ ' ' }}
<a href="#" class="font-medium text-indigo-600 hover:text-indigo-500">start your 14-day free trial</a>
</p>
</div>

<div class="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div>
<form class="space-y-6" action="#" method="POST">
<div>
<label for="email" class="block text-sm font-medium text-gray-700">Email address</label>
<div class="mt-1">
<input id="email" name="email" type="email" autocomplete="email" required=""
class="block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" />
</div>
</div>
<div class="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div>
<form class="space-y-6" action="#" method="POST">
<div>
<label for="email" class="block text-sm font-medium text-gray-700">Email address</label>
<div class="mt-1">
<input
id="email"
name="email"
type="email"
autocomplete="email"
required=""
class="block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm"
>
</div>
</div>

<div>
<label for="password" class="block text-sm font-medium text-gray-700">Password</label>
<div class="mt-1">
<input id="password" name="password" type="password" autocomplete="current-password"
required=""
class="block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" />
</div>
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700">Password</label>
<div class="mt-1">
<input
id="password"
name="password"
type="password"
autocomplete="current-password"
required=""
class="block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm"
>
</div>
</div>

<div class="flex items-center justify-between">
<div class="flex items-center">
<input id="remember-me" name="remember-me" type="checkbox"
class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500" />
<label for="remember-me" class="ml-2 block text-sm text-gray-900">Remember me</label>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center">
<input
id="remember-me"
name="remember-me"
type="checkbox"
class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"
>
<label for="remember-me" class="ml-2 block text-sm text-gray-900">Remember me</label>
</div>

<div class="text-sm">
<a href="#" class="font-medium text-indigo-600 hover:text-indigo-500">Forgot your
password?</a>
</div>
</div>
<div class="text-sm">
<a href="#" class="font-medium text-indigo-600 hover:text-indigo-500">Forgot your
password?</a>
</div>
</div>

<div>
<button type="submit"
class="flex w-full justify-center rounded-md border border-transparent bg-indigo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">Sign
in</button>
</div>
</form>
<div>
<button
type="submit"
class="flex w-full justify-center rounded-md border border-transparent bg-indigo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
>
Sign
in
</button>
</div>
</form>

<div class="mt-6">
<div class="relative">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-300" />
</div>
<div class="relative flex justify-center text-sm">
<span class="bg-white px-2 text-gray-500">Or continue with</span>
</div>
</div>
<div class="mt-6">
<div class="relative">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-300" />
</div>
<div class="relative flex justify-center text-sm">
<span class="bg-white px-2 text-gray-500">Or continue with</span>
</div>
</div>

<div class="mt-6 grid grid-cols-3 gap-3">
<div>
<a href="#"
class="inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50">
<span class="sr-only">Sign in with Facebook</span>
<svg class="h-5 w-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd"
d="M20 10c0-5.523-4.477-10-10-10S0 4.477 0 10c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V10h2.54V7.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V10h2.773l-.443 2.89h-2.33v6.988C16.343 19.128 20 14.991 20 10z"
clip-rule="evenodd" />
</svg>
</a>
</div>
<div class="mt-6 grid grid-cols-3 gap-3">
<div>
<a
href="#"
class="inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50"
>
<span class="sr-only">Sign in with Facebook</span>
<svg class="h-5 w-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20">
<path
fill-rule="evenodd"
d="M20 10c0-5.523-4.477-10-10-10S0 4.477 0 10c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V10h2.54V7.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V10h2.773l-.443 2.89h-2.33v6.988C16.343 19.128 20 14.991 20 10z"
clip-rule="evenodd"
/>
</svg>
</a>
</div>

<div>
<a href="#"
class="inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50">
<span class="sr-only">Sign in with Twitter</span>
<svg class="h-5 w-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20">
<path
d="M6.29 18.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0020 3.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.073 4.073 0 01.8 7.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 010 16.407a11.616 11.616 0 006.29 1.84" />
</svg>
</a>
</div>
<div>
<a
href="#"
class="inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50"
>
<span class="sr-only">Sign in with Twitter</span>
<svg class="h-5 w-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20">
<path
d="M6.29 18.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0020 3.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.073 4.073 0 01.8 7.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 010 16.407a11.616 11.616 0 006.29 1.84"
/>
</svg>
</a>
</div>

<div>
<a href="#"
class="inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50">
<span class="sr-only">Sign in with GitHub</span>
<svg class="h-5 w-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd"
d="M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z"
clip-rule="evenodd" />
</svg>
</a>
</div>
</div>
</div>
<div>
<a
href="#"
class="inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50"
>
<span class="sr-only">Sign in with GitHub</span>
<svg class="h-5 w-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20">
<path
fill-rule="evenodd"
d="M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z"
clip-rule="evenodd"
/>
</svg>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
</script>
</script>
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"generate": "nuxi generate",
"preview": "nuxi preview",
"postinstall": "nuxi prepare",
"lint": "eslint ."
"lint": "npx eslint . --ext .js --ext .ts"
},
"dependencies": {
"@nuxt/content": "^2.2.0",
Expand All @@ -22,10 +22,14 @@
"devDependencies": {
"@nuxthq/studio": "^0.1.0",
"@nuxtjs/eslint-config-typescript": "^11.0.0",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"content-wind": "^0.2.4",
"eslint": "^8.25.0",
"eslint": ">=5.16.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-vue": "^9.7.0",
"nuxt": "^3.0.0-rc.12",
"standard-version": "^9.5.0",
"typescript": "^4.8.4"
}
}
}
Loading

0 comments on commit bdab36b

Please sign in to comment.