Skip to content

Commit a320ded

Browse files
committed
Add eslint
1 parent ce97014 commit a320ded

File tree

22 files changed

+1569
-42
lines changed

22 files changed

+1569
-42
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- name: Build and run dev container task
1717
uses: devcontainers/[email protected]
1818
with:
19-
runCmd: pnpm run build && pnpm run lint
19+
runCmd: pnpm -w run build && pnpm -w run lint

errorpages/eslint.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @ts-check
2+
import withNuxt from './.nuxt/eslint.config.mjs'
3+
4+
export default withNuxt(
5+
// Your custom configs here
6+
)

errorpages/nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import routes from "./pages";
22

33
export default defineNuxtConfig({
44
compatibilityDate: "2024-10-19",
5+
modules: ["@nuxt/eslint"],
56

67
app: {
78
head: {

errorpages/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
"scripts": {
55
"build": "nuxt generate",
66
"dev": "nuxt dev --port=3001",
7-
"lint": "nuxt typecheck",
7+
"lint": "nuxt typecheck && eslint .",
88
"postinstall": "nuxt prepare"
99
},
1010
"dependencies": {
1111
"@workspace/ui-lib": "workspace:^"
1212
},
1313
"devDependencies": {
14+
"@nuxt/eslint": "^0.6.0",
1415
"@types/node": "^18.19.57",
1516
"nuxt": "^3.13.2",
1617
"sass": "^1.80.3"

errorpages/pages/_error/[id].html.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ useSeoMeta({ title: `${errorpage?.name} - Chirality` });
1010
</script>
1111

1212
<template>
13-
<h1>{{ errorpage?.name }}</h1>
14-
<sub>{{ errorpage?.subtitle }}</sub>
15-
<p>{{ errorpage?.title }}</p>
13+
<div>
14+
<h1>{{ errorpage?.name }}</h1>
15+
<sub>{{ errorpage?.subtitle }}</sub>
16+
<p>{{ errorpage?.title }}</p>
17+
</div>
1618
</template>
1719

1820
<style lang="scss">

home/components/TileContainer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ defineProps<{ tiles: Tile[]; }>();
66

77
<template>
88
<section>
9-
<a class="tile" v-for="tile in tiles" :href="tile.url">
9+
<a v-for="tile in tiles" :key="tile.name" class="tile" :href="tile.url">
1010
<div class="image-container">
11-
<img width="80" height="80" :src="`/icons/${tile.icon}`" alt="" />
11+
<img width="80" height="80" :src="`/icons/${tile.icon}`" alt="">
1212
</div>
1313
<p>{{ tile.name }}</p>
1414
</a>

home/eslint.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @ts-check
2+
import withNuxt from './.nuxt/eslint.config.mjs'
3+
4+
export default withNuxt(
5+
// Your custom configs here
6+
)

home/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"scripts": {
44
"build": "nuxt build",
55
"dev": "nuxt dev --port=3000",
6-
"lint": "nuxt typecheck",
6+
"lint": "nuxt typecheck && eslint .",
77
"postinstall": "nuxt prepare"
88
},
99
"dependencies": {

home/pages/index.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ useSeoMeta({ description: `${appName} Service Dashboard` });
66
</script>
77

88
<template>
9-
<AppHeader :username="data!.username" />
10-
<TileContainer :tiles="data!.tiles" />
9+
<div>
10+
<AppHeader :username="data!.username" />
11+
<TileContainer :tiles="data!.tiles" />
12+
</div>
1113
</template>

home/server/api/home.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import { getUser } from "~/src/user";
22
import { getServices } from "~/src/services";
33

44
export default defineEventHandler((e) => {
5-
let user = getUser(e.node.req.headers);
5+
const user = getUser(e.node.req.headers);
66

7-
e.node.req.headers;
87
return {
98
username: user.name,
109
tiles: getServices(user),

home/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function getConfig(): Config {
1919
}
2020

2121
function loadConfig(): Config {
22-
let configString = fs.readFileSync(`${process.cwd()}/config.yml`);
22+
const configString = fs.readFileSync(`${process.cwd()}/config.yml`);
2323

2424
return yaml.parse(configString.toString());
2525
}

home/src/user.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const RemoteGroups = "remote-groups";
66
const RemoteName = "remote-name";
77

88
export function getUser(headers: IncomingHttpHeaders): User {
9-
let user = headers[RemoteUser] as string;
10-
let name = headers[RemoteName] as string ?? user;
11-
let groups = headers[RemoteGroups] as string ?? "";
9+
const user = headers[RemoteUser] as string;
10+
const name = headers[RemoteName] as string ?? user;
11+
const groups = headers[RemoteGroups] as string ?? "";
1212

1313
if (!user) {
1414
throw new Error("Remote-User header is not set");

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"down": "docker-compose down --remove-orphans"
99
},
1010
"devDependencies": {
11+
"eslint": "^9.13.0",
1112
"vue-tsc": "^2.1.6"
1213
}
1314
}

0 commit comments

Comments
 (0)