Skip to content

Commit 328c60b

Browse files
committed
fix: added esLint
1 parent c6dee83 commit 328c60b

15 files changed

+569
-250
lines changed

.eslintrc.js

+2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ module.exports = {
2323
'parserOptions': {
2424
'ecmaVersion': 'latest',
2525
'sourceType': 'module',
26+
'parser': '@typescript-eslint/parser',
2627
},
2728
'plugins': [
2829
'vue',
30+
'@typescript-eslint',
2931
],
3032
'rules': {
3133
'vue/multi-word-component-names': 'off',

app.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<NuxtLayout>
33
<NuxtPage />
44
</NuxtLayout>
5-
</template>
5+
</template>

middleware/watchdog.global.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
// Define a route middleware function that handles user authentication.
22
export default defineNuxtRouteMiddleware((to, from) => {
33
// Get the 'user' state variable using 'useState'.
4-
const user = useState('user')
4+
const user = useState('user');
55

66
// Define an array of allowed routes that do not require authentication.
7-
const allowedRoutes = ['/', '/login']
7+
const allowedRoutes = ['/', '/login'];
88

99
// Check if the user is authenticated.
1010
if (user.value) {
1111
// If the user is authenticated and tries to access an allowed route
1212
// other than the root ('/'), redirect to the root.
1313
if (allowedRoutes.includes(to.path) && to.path !== '/') {
14-
return navigateTo('/')
14+
return navigateTo('/');
1515
}
1616
} else {
1717
// If the user is not authenticated and tries to access a route
1818
// that is not in the list of allowed routes, redirect to the login page.
1919
if (!allowedRoutes.includes(to.path)) {
20-
return navigateTo('/login')
20+
return navigateTo('/login');
2121
}
2222
}
23-
})
23+
});

nuxt.config.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ const {
55
AUTH0_ISSUER_BASE_URL,
66
AUTH0_CLIENT_ID,
77
AUTH0_CLIENT_SECRET,
8-
AUTH0_COOKIE_NAME
9-
} = process.env
8+
AUTH0_COOKIE_NAME,
9+
} = process.env;
1010

1111
export default defineNuxtConfig({
12-
devtools: { enabled: true },
12+
devtools: {enabled: true},
1313
// css
14-
css: ['~/assets/scss/index.scss', ],
14+
css: ['~/assets/scss/index.scss'],
1515

1616
runtimeConfig: {
1717
dburl: process.env.DATABASE_URL,
@@ -25,15 +25,15 @@ export default defineNuxtConfig({
2525
AUTH0_CLIENT_SECRET,
2626
AUTH0_COOKIE_NAME,
2727
public: {
28-
AUTH0_COOKIE_NAME
29-
}
28+
AUTH0_COOKIE_NAME,
29+
},
3030
},
3131

3232
modules: [
3333
'@element-plus/nuxt',
3434
'@vueuse/nuxt',
3535
'@nuxtjs/color-mode',
36-
'@pinia/nuxt'
36+
'@pinia/nuxt',
3737
],
3838
vite: {
3939
// vue: {
@@ -48,7 +48,7 @@ export default defineNuxtConfig({
4848
additionalData: `@use "@/assets/scss/element/index.scss" as element;`,
4949
},
5050
},
51-
}
51+
},
5252
},
5353
// vue: {
5454
// compilerOptions: {
@@ -66,4 +66,4 @@ export default defineNuxtConfig({
6666
importStyle: 'scss',
6767
themes: ['dark'],
6868
},
69-
})
69+
});

0 commit comments

Comments
 (0)