Skip to content

Commit 05b52a9

Browse files
committed
Update formatter, linter and ts configs
1 parent 8eebdce commit 05b52a9

12 files changed

Lines changed: 981 additions & 1073 deletions

File tree

.oxlintrc.json

Lines changed: 9 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,20 @@
11
{
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
3-
"plugins": ["unicorn", "typescript", "oxc"],
4-
"categories": {},
3+
"plugins": ["typescript", "vue", "unicorn", "oxc"],
4+
"categories": {
5+
"correctness": "warn",
6+
"suspicious": "warn",
7+
"perf": "warn"
8+
},
59
"rules": {
6-
"for-direction": "warn",
7-
"no-async-promise-executor": "warn",
8-
"no-caller": "warn",
9-
"no-class-assign": "warn",
10-
"no-compare-neg-zero": "warn",
11-
"no-cond-assign": "warn",
12-
"no-const-assign": "warn",
13-
"no-constant-binary-expression": "warn",
14-
"no-constant-condition": "warn",
15-
"no-control-regex": "warn",
16-
"no-debugger": "warn",
17-
"no-delete-var": "warn",
18-
"no-dupe-class-members": "warn",
19-
"no-dupe-else-if": "warn",
20-
"no-dupe-keys": "warn",
21-
"no-duplicate-case": "warn",
22-
"no-empty-character-class": "warn",
23-
"no-empty-pattern": "warn",
24-
"no-empty-static-block": "warn",
25-
"no-eval": "warn",
26-
"no-ex-assign": "warn",
27-
"no-extra-boolean-cast": "warn",
28-
"no-func-assign": "warn",
29-
"no-global-assign": "warn",
30-
"no-import-assign": "warn",
31-
"no-invalid-regexp": "warn",
32-
"no-irregular-whitespace": "warn",
33-
"no-loss-of-precision": "warn",
34-
"no-new-native-nonconstructor": "warn",
35-
"no-nonoctal-decimal-escape": "warn",
36-
"no-obj-calls": "warn",
37-
"no-self-assign": "warn",
38-
"no-setter-return": "warn",
39-
"no-shadow-restricted-names": "warn",
40-
"no-sparse-arrays": "warn",
41-
"no-this-before-super": "warn",
42-
"no-unsafe-finally": "warn",
43-
"no-unsafe-negation": "warn",
44-
"no-unsafe-optional-chaining": "warn",
45-
"no-unused-labels": "warn",
46-
"no-unused-private-class-members": "warn",
47-
"no-unused-vars": "warn",
48-
"no-useless-backreference": "warn",
49-
"no-useless-catch": "warn",
50-
"no-useless-escape": "warn",
51-
"no-useless-rename": "warn",
52-
"no-with": "warn",
53-
"require-yield": "warn",
54-
"use-isnan": "warn",
55-
"valid-typeof": "warn",
56-
"oxc/bad-array-method-on-arguments": "warn",
57-
"oxc/bad-char-at-comparison": "warn",
58-
"oxc/bad-comparison-sequence": "warn",
59-
"oxc/bad-min-max-func": "warn",
60-
"oxc/bad-object-literal-comparison": "warn",
61-
"oxc/bad-replace-all-arg": "warn",
62-
"oxc/const-comparisons": "warn",
63-
"oxc/double-comparisons": "warn",
64-
"oxc/erasing-op": "warn",
65-
"oxc/missing-throw": "warn",
66-
"oxc/number-arg-out-of-range": "warn",
67-
"oxc/only-used-in-recursion": "warn",
68-
"oxc/uninvoked-array-callback": "warn",
69-
"typescript/no-duplicate-enum-values": "warn",
70-
"typescript/no-extra-non-null-assertion": "warn",
71-
"typescript/no-misused-new": "warn",
72-
"typescript/no-non-null-asserted-optional-chain": "warn",
73-
"typescript/no-this-alias": "warn",
74-
"typescript/no-unnecessary-parameter-property-assignment": "warn",
75-
"typescript/no-unsafe-declaration-merging": "warn",
76-
"typescript/no-useless-empty-export": "warn",
77-
"typescript/no-wrapper-object-types": "warn",
78-
"typescript/prefer-as-const": "warn",
79-
"typescript/triple-slash-reference": "warn",
80-
"unicorn/no-await-in-promise-methods": "warn",
81-
"unicorn/no-empty-file": "warn",
82-
"unicorn/no-invalid-fetch-options": "warn",
83-
"unicorn/no-invalid-remove-event-listener": "warn",
10+
"typescript/no-explicit-any": "warn",
8411
"unicorn/no-new-array": "warn",
85-
"unicorn/no-single-promise-in-promise-methods": "warn",
86-
"unicorn/no-thenable": "warn",
87-
"unicorn/no-unnecessary-await": "warn",
88-
"unicorn/no-useless-fallback-in-spread": "warn",
89-
"unicorn/no-useless-length-check": "warn",
90-
"unicorn/no-useless-spread": "warn",
91-
"unicorn/prefer-set-size": "warn",
9212
"unicorn/prefer-string-starts-ends-with": "warn"
9313
},
94-
"settings": {
95-
"next": {
96-
"rootDir": []
97-
}
98-
},
9914
"env": {
15+
"browser": true,
10016
"builtin": true
10117
},
10218
"globals": {},
103-
"ignorePatterns": []
19+
"ignorePatterns": ["dist", "node_modules"]
10420
}

.prettierrc.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
2-
"arrowParens": "avoid",
3-
"endOfLine": "auto",
2+
"semi": true,
3+
"singleQuote": false,
4+
"useTabs": true,
45
"printWidth": 120,
5-
"proseWrap": "never",
66
"trailingComma": "es5",
7-
"useTabs": true,
7+
"arrowParens": "avoid",
8+
"endOfLine": "lf",
9+
"proseWrap": "never",
810
"plugins": ["prettier-plugin-organize-attributes", "prettier-plugin-tailwindcss"],
911
"tailwindStylesheet": "./src/assets/css/index.css"
1012
}

src/components/ScrollToTop.vue

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
1-
<script setup lang="ts">
2-
import { computed, onMounted, onUnmounted, ref } from "vue";
3-
import ScrollToTopArrow from "@assets/scroll-to-top-arrow.svg";
4-
5-
const maxHeight = 100;
6-
7-
const progressTextContent = ref<string>("");
8-
9-
const scrollPosition = ref<number>(0);
10-
const progressWrapperStyle = computed((): string => (scrollPosition.value > maxHeight ? "grid" : "none"));
11-
const progressWrapperBackground = ref<string>("");
12-
13-
const onScroll = (): void => {
14-
scrollPosition.value = document.documentElement.scrollTop;
15-
const calcHeight = document.documentElement.scrollHeight - document.documentElement.clientHeight;
16-
17-
const scrollValue = Math.round(Math.floor(scrollPosition.value * maxHeight) / calcHeight);
18-
19-
progressWrapperBackground.value = `conic-gradient(#00cc99 ${scrollValue}%, #d7d7d7 ${scrollValue}%)`;
20-
progressTextContent.value = `${scrollValue}%`;
21-
};
22-
23-
const scrollToTop = (): void => {
24-
window.scrollTo(0, 0);
25-
};
26-
27-
onMounted(() => {
28-
window.addEventListener("scroll", onScroll);
29-
});
30-
31-
onUnmounted(() => {
32-
window.addEventListener("scroll", onScroll);
33-
});
34-
</script>
35-
36-
<template>
37-
<div
38-
class="fixed right-5 bottom-3 hidden h-12 w-12 cursor-pointer place-items-center rounded-full opacity-70 duration-300 ease-in hover:opacity-100 dark:opacity-50 dark:hover:opacity-50"
39-
:style="{ display: progressWrapperStyle, background: progressWrapperBackground }"
40-
@click="scrollToTop"
41-
>
42-
<span
43-
class="progress-content flex flex-col items-center justify-center rounded-full bg-white text-[11px] font-medium text-slate-950 select-none"
44-
id="progress-content"
45-
title="Scroll To Top"
46-
>
47-
<ScrollToTopArrow class="-mb-[2px] opacity-70" />
48-
49-
<span>{{ progressTextContent }}</span>
50-
</span>
51-
</div>
52-
</template>
53-
54-
<style lang="css" scoped>
55-
.progress-content {
56-
--border-value: 10px;
57-
58-
height: calc(100% - var(--border-value));
59-
width: calc(100% - var(--border-value));
60-
}
61-
</style>
1+
<script setup lang="ts">
2+
import { computed, onMounted, onUnmounted, ref } from "vue";
3+
import ScrollToTopArrow from "@assets/scroll-to-top-arrow.svg";
4+
5+
const maxHeight = 100;
6+
7+
const progressTextContent = ref<string>("");
8+
9+
const scrollPosition = ref<number>(0);
10+
const progressWrapperStyle = computed((): string => (scrollPosition.value > maxHeight ? "grid" : "none"));
11+
const progressWrapperBackground = ref<string>("");
12+
13+
const onScroll = (): void => {
14+
scrollPosition.value = document.documentElement.scrollTop;
15+
const calcHeight = document.documentElement.scrollHeight - document.documentElement.clientHeight;
16+
17+
const scrollValue = Math.round(Math.floor(scrollPosition.value * maxHeight) / calcHeight);
18+
19+
progressWrapperBackground.value = `conic-gradient(#00cc99 ${scrollValue}%, #d7d7d7 ${scrollValue}%)`;
20+
progressTextContent.value = `${scrollValue}%`;
21+
};
22+
23+
const scrollToTop = (): void => {
24+
window.scrollTo(0, 0);
25+
};
26+
27+
onMounted(() => {
28+
window.addEventListener("scroll", onScroll);
29+
});
30+
31+
onUnmounted(() => {
32+
window.addEventListener("scroll", onScroll);
33+
});
34+
</script>
35+
36+
<template>
37+
<div
38+
class="fixed right-5 bottom-3 hidden h-12 w-12 cursor-pointer place-items-center rounded-full opacity-70 duration-300 ease-in hover:opacity-100 dark:opacity-50 dark:hover:opacity-50"
39+
:style="{ display: progressWrapperStyle, background: progressWrapperBackground }"
40+
@click="scrollToTop"
41+
>
42+
<span
43+
class="progress-content flex flex-col items-center justify-center rounded-full bg-white text-[11px] font-medium text-slate-950 select-none"
44+
id="progress-content"
45+
title="Scroll To Top"
46+
>
47+
<ScrollToTopArrow class="-mb-[2px] opacity-70" />
48+
49+
<span>{{ progressTextContent }}</span>
50+
</span>
51+
</div>
52+
</template>
53+
54+
<style lang="css" scoped>
55+
.progress-content {
56+
--border-value: 10px;
57+
58+
height: calc(100% - var(--border-value));
59+
width: calc(100% - var(--border-value));
60+
}
61+
</style>

src/components/SearchResults.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<script setup lang="ts">
2-
defineProps<{ results: number }>();
3-
</script>
4-
5-
<template>
6-
<div class="text-sm font-normal whitespace-nowrap text-gray-600 dark:text-gray-400">
7-
<span v-show="results"> {{ results }} {{ results > 1 ? "verbs" : "verb" }} </span>
8-
</div>
9-
</template>
1+
<script setup lang="ts">
2+
defineProps<{ results: number }>();
3+
</script>
4+
5+
<template>
6+
<div class="text-sm font-normal whitespace-nowrap text-gray-600 dark:text-gray-400">
7+
<span v-show="results"> {{ results }} {{ results > 1 ? "verbs" : "verb" }} </span>
8+
</div>
9+
</template>

src/components/SourceLink.vue

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
<script setup lang="ts">
2-
import sourceFile from "@/data/irregular_verbs.pdf";
3-
import SourceIcon from "@assets/to-right-arrow.svg";
4-
</script>
5-
6-
<template>
7-
<p class="my-4 text-center text-gray-500 dark:text-gray-400">
8-
List of irregular verbs
9-
<a
10-
class="inline-flex items-center font-medium text-blue-600 duration-300 ease-in hover:underline dark:text-blue-500"
11-
target="_blank"
12-
title="Open source file"
13-
aria-label="Open source file"
14-
:href="sourceFile"
15-
>
16-
Source
17-
<SourceIcon class="ml-1 size-5" />
18-
</a>
19-
</p>
20-
</template>
1+
<script setup lang="ts">
2+
import sourceFile from "@/data/irregular_verbs.pdf";
3+
import SourceIcon from "@assets/to-right-arrow.svg";
4+
</script>
5+
6+
<template>
7+
<p class="my-4 text-center text-gray-500 dark:text-gray-400">
8+
List of irregular verbs
9+
<a
10+
class="inline-flex items-center font-medium text-blue-600 duration-300 ease-in hover:underline dark:text-blue-500"
11+
target="_blank"
12+
title="Open source file"
13+
aria-label="Open source file"
14+
:href="sourceFile"
15+
>
16+
Source
17+
<SourceIcon class="ml-1 size-5" />
18+
</a>
19+
</p>
20+
</template>

0 commit comments

Comments
 (0)