mirror of
https://github.com/YouHaveTrouble/DiscipleOfLand.git
synced 2026-05-11 22:16:55 +00:00
install and configure eslint, bow before eslint
This commit is contained in:
Generated
+1534
-28
File diff suppressed because it is too large
Load Diff
+28
-3
@@ -2,18 +2,43 @@
|
||||
"name": "discipleofland",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build && cp -r CNAME dist/CNAME",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"sass": "^1.67.0",
|
||||
"typescript": "^5.2.2",
|
||||
"vue": "^3.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"sass": "^1.67.0",
|
||||
"typescript": "^5.2.2",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.5",
|
||||
"@typescript-eslint/parser": "^6.7.5",
|
||||
"@vitejs/plugin-vue": "^4.2.3",
|
||||
"vite": "^4.3.9"
|
||||
"@vue/eslint-config-typescript": "^12.0.0",
|
||||
"eslint": "^8.51.0",
|
||||
"eslint-plugin-vue": "^9.17.0",
|
||||
"vite": "^4.3.9",
|
||||
"vue-eslint-parser": "^9.3.2",
|
||||
"vite-plugin-eslint": "^1.8.1"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"parser": "vue-eslint-parser",
|
||||
"extends": [
|
||||
"plugin:vue/strongly-recommended",
|
||||
"eslint:recommended",
|
||||
"@vue/typescript/recommended"
|
||||
],
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": 2020
|
||||
},
|
||||
"ignorePatterns": [
|
||||
"dist/"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+10
-9
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<nav>
|
||||
<div class="current-eorzea-time">
|
||||
{{ eorzeaTime.getPrettyTime() }}
|
||||
@@ -6,12 +7,12 @@
|
||||
</nav>
|
||||
<main>
|
||||
<SortedNodeList
|
||||
:nodes="nodes"
|
||||
:nodes="nodes as Node[]"
|
||||
:zones="zones"
|
||||
:eorzeaTime="eorzeaTime"
|
||||
:eorzea-time="eorzeaTime"
|
||||
/>
|
||||
</main>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -59,8 +60,8 @@ export default defineComponent({
|
||||
this.eorzeaTime = new EorzeaTime();
|
||||
}, 500);
|
||||
|
||||
const aetheryteData = await fetch("/data/aetherytes.json")
|
||||
.catch(() => {
|
||||
const aetheryteData: Response | null = await fetch("/data/aetherytes.json")
|
||||
.catch((): null => {
|
||||
return null;
|
||||
});
|
||||
if (aetheryteData === null) {
|
||||
@@ -73,8 +74,8 @@ export default defineComponent({
|
||||
this.aetherytes.push(new Aetheryte(aetheryteData));
|
||||
}
|
||||
|
||||
const itemData = await fetch("/data/items.json")
|
||||
.catch(() => {
|
||||
const itemData: Response | null = await fetch("/data/items.json")
|
||||
.catch((): null => {
|
||||
return null;
|
||||
});
|
||||
if (itemData === null) {
|
||||
@@ -88,8 +89,8 @@ export default defineComponent({
|
||||
this.items[itemId] = new Item(itemId, itemData);
|
||||
}
|
||||
|
||||
const zoneData = await fetch("/data/zones.json")
|
||||
.catch(() => {
|
||||
const zoneData: Response | null = await fetch("/data/zones.json")
|
||||
.catch((): null => {
|
||||
return null;
|
||||
});
|
||||
if (zoneData === null) {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<article class="node">
|
||||
<div class="timer">{{ gatheringNode.isActive(eorzeaTime) ? 'Active' : prettyTimer(gatheringNode.getSecondsToNextActiveTime(eorzeaTime)) }}</div>
|
||||
<article class="node">
|
||||
<div class="timer">
|
||||
{{
|
||||
gatheringNode.isActive(eorzeaTime) ? 'Active' : prettyTimer(gatheringNode.getSecondsToNextActiveTime(eorzeaTime))
|
||||
}}
|
||||
</div>
|
||||
<div class="job">
|
||||
<div class="icon">
|
||||
<img
|
||||
@@ -13,19 +17,27 @@
|
||||
</div>
|
||||
<div class="aetheryte">
|
||||
<span class="icon">
|
||||
<img src="https://xivapi.com/img-misc/mappy/aetheryte.png" alt="Aetheryte icon" draggable="false">
|
||||
<img
|
||||
src="https://xivapi.com/img-misc/mappy/aetheryte.png"
|
||||
alt="Aetheryte icon"
|
||||
draggable="false"
|
||||
>
|
||||
</span>
|
||||
<div class="info">
|
||||
<span>{{ zones[gatheringNode.nearestAetheryte.position.zone]?.name?.en }}</span>
|
||||
<span>{{ gatheringNode.nearestAetheryte.name }}</span>
|
||||
<span>{{ gatheringNode.nearestAetheryte.name.en }}</span>
|
||||
<span>{{ gatheringNode.nearestAetheryte.position.x }}, {{ gatheringNode.nearestAetheryte.position.y }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<span v-for="item in gatheringNode.items">{{ item.name }} (lv. {{ item.level }})</span>
|
||||
<span
|
||||
v-for="item in gatheringNode.items"
|
||||
:key="item.name"
|
||||
>
|
||||
{{ item.name }} (lv. {{ item.level }})
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -71,6 +83,7 @@ export default defineComponent({
|
||||
border: 1px solid #fff;
|
||||
padding: 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
|
||||
.timer {
|
||||
min-width: 7rem;
|
||||
font-size: 2rem;
|
||||
@@ -78,19 +91,23 @@ export default defineComponent({
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.job {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.aetheryte {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -100,15 +117,18 @@ export default defineComponent({
|
||||
font-size: 1.5rem;
|
||||
border-radius: 0.75rem;
|
||||
padding: 0.35rem 1rem;
|
||||
background-color: rgba(0,0,0, 0.2);
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
|
||||
.icon {
|
||||
width: 3rem;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: fill;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -117,6 +137,7 @@ export default defineComponent({
|
||||
gap: 0.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<div class="node-list">
|
||||
<div class="node-list">
|
||||
<GatheringNode
|
||||
v-for="node in displayNodes"
|
||||
:gathering-node="node"
|
||||
:eorzeaTime="eorzeaTime"
|
||||
:key="`${node.location.x}-${node.location.y}-${node.location.zone}`"
|
||||
:gathering-node="node as Node"
|
||||
:eorzea-time="eorzeaTime"
|
||||
:zones="zones"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -55,10 +56,10 @@ export default defineComponent(
|
||||
}),
|
||||
methods: {
|
||||
sortListByTime() {
|
||||
this.displayNodes.sort((a, b) => {
|
||||
this.displayNodes.sort((a, b): number => {
|
||||
const aSeconds = a.getSecondsToNextActiveTime(this.eorzeaTime);
|
||||
const bSeconds = b.getSecondsToNextActiveTime(this.eorzeaTime);
|
||||
if (aSeconds === bSeconds) return a;
|
||||
if (aSeconds === bSeconds) return 1;
|
||||
return aSeconds - bSeconds;
|
||||
});
|
||||
},
|
||||
|
||||
@@ -6,10 +6,10 @@ export default class Aetheryte {
|
||||
}
|
||||
|
||||
constructor(
|
||||
data: any,
|
||||
data: {position: {x: number, y: number, zone: string}, name: {en: string}}
|
||||
) {
|
||||
this.position = data.position;
|
||||
this.name = data.name.en;
|
||||
this.name = data.name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+10
-5
@@ -3,13 +3,18 @@ export default class Item {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly level: number;
|
||||
readonly scripType: ScripType;
|
||||
readonly scripType: ScripType | null;
|
||||
|
||||
constructor(id: string, data: any) {
|
||||
constructor(id: string, data: {[key: string]: number | string | undefined}) {
|
||||
this.id = id;
|
||||
this.name = data?.name;
|
||||
this.level = data?.level;
|
||||
this.scripType = data?.scripType ? ScripType[data.scripType.toUpperCase()] : null;
|
||||
this.name = data?.name as string;
|
||||
this.level = data?.level as number;
|
||||
const scripType: string | undefined = data?.scripType as string;
|
||||
if (scripType != undefined) {
|
||||
this.scripType = typeof data?.scripType === "string" ? scripType.toUpperCase() as ScripType : null;
|
||||
} else {
|
||||
this.scripType = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Job} from "../enums/Job";
|
||||
import {NodeType} from "../enums/NodeType";
|
||||
import {Job} from "@/enums/Job";
|
||||
import {NodeType} from "@/enums/NodeType";
|
||||
import Item from "./Item";
|
||||
import Aetheryte from "./Aetheryte";
|
||||
import TimeRange from "./TimeRange";
|
||||
|
||||
@@ -4,8 +4,10 @@ export default class Zone {
|
||||
en: string,
|
||||
}
|
||||
|
||||
constructor(data: any) {
|
||||
this.name = data.name;
|
||||
constructor(data: {name: {en: string}}) {
|
||||
this.name = {
|
||||
en: data.name.en
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ export default class EorzeaTime {
|
||||
*/
|
||||
readonly eorzeaDate: Date;
|
||||
|
||||
private constructor(realDate: Date = new Date()) {
|
||||
public constructor(realDate: Date = new Date()) {
|
||||
this.realDate = realDate;
|
||||
this.eorzeaDate = new Date(realDate.getTime() * (3600 / 175));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"strict": true,
|
||||
"jsx": "preserve",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
||||
}
|
||||
@@ -2,11 +2,13 @@ import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import eslintPlugin from 'vite-plugin-eslint'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
eslintPlugin(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
Reference in New Issue
Block a user