Skip to content

Commit 49cd66f

Browse files
committed
lint
1 parent 7d3937c commit 49cd66f

54 files changed

Lines changed: 1656 additions & 1555 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintcache

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

eslint.config.js

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
import unicorn from "eslint-plugin-unicorn";
2+
import typescript from "@typescript-eslint/eslint-plugin";
3+
import typescriptParser from "@typescript-eslint/parser";
4+
import vue from "eslint-plugin-vue";
5+
import vueParser from "vue-eslint-parser";
6+
7+
export default [
8+
{
9+
ignores: [
10+
"node_modules/**",
11+
"dist/**",
12+
".nuxt/**",
13+
"packages/*/dist/**",
14+
"packages/app/.nuxt/**",
15+
"packages/cli/dist/**",
16+
],
17+
},
18+
// JavaScript and TypeScript files
19+
{
20+
files: ["**/*.js", "**/*.ts"],
21+
languageOptions: {
22+
ecmaVersion: 2022,
23+
sourceType: "module",
24+
parser: typescriptParser,
25+
parserOptions: {
26+
ecmaFeatures: {
27+
jsx: true,
28+
},
29+
},
30+
},
31+
linterOptions: {
32+
reportUnusedDisableDirectives: true,
33+
},
34+
plugins: {
35+
unicorn,
36+
"@typescript-eslint": typescript,
37+
},
38+
rules: {
39+
// Basic rules
40+
"no-console": "warn",
41+
"no-debugger": "warn",
42+
"no-unused-vars": "warn",
43+
"prefer-const": "error",
44+
"no-useless-constructor": "error",
45+
46+
// TypeScript rules
47+
"@typescript-eslint/no-unused-vars": [
48+
"warn",
49+
{
50+
argsIgnorePattern: "^_",
51+
varsIgnorePattern: "^_",
52+
},
53+
],
54+
"@typescript-eslint/no-namespace": "error",
55+
"@typescript-eslint/no-non-null-assertion": "off",
56+
57+
// Async rules
58+
"require-await": "off",
59+
60+
// Unicorn rules
61+
"unicorn/no-null": "off",
62+
"unicorn/filename-case": "off",
63+
"unicorn/no-process-exit": "error",
64+
"unicorn/prefer-ternary": "off",
65+
"unicorn/prefer-top-level-await": "off",
66+
"unicorn/prefer-code-point": "off",
67+
"unicorn/prefer-string-slice": "off",
68+
"unicorn/prefer-at": "off",
69+
"unicorn/explicit-length-check": "off",
70+
"unicorn/prefer-set-has": "off",
71+
"unicorn/no-empty-file": "error",
72+
73+
// Other rules
74+
camelcase: "off",
75+
"no-empty": [
76+
"error",
77+
{
78+
allowEmptyCatch: true,
79+
},
80+
],
81+
},
82+
},
83+
// Vue files
84+
{
85+
files: ["**/*.vue"],
86+
languageOptions: {
87+
parser: vueParser,
88+
parserOptions: {
89+
parser: typescriptParser,
90+
ecmaVersion: 2022,
91+
sourceType: "module",
92+
ecmaFeatures: {
93+
jsx: true,
94+
},
95+
extraFileExtensions: [".vue"],
96+
},
97+
},
98+
plugins: {
99+
vue,
100+
"@typescript-eslint": typescript,
101+
unicorn,
102+
},
103+
rules: {
104+
// Vue rules
105+
"vue/multi-word-component-names": "off",
106+
"vue/no-unused-vars": "warn",
107+
"vue/no-v-html": "off",
108+
109+
// Basic rules
110+
"no-console": "warn",
111+
"no-debugger": "warn",
112+
"prefer-const": "error",
113+
114+
// TypeScript rules
115+
"@typescript-eslint/no-unused-vars": [
116+
"warn",
117+
{
118+
argsIgnorePattern: "^_",
119+
varsIgnorePattern: "^_",
120+
},
121+
],
122+
"@typescript-eslint/no-namespace": "error",
123+
"@typescript-eslint/no-non-null-assertion": "off",
124+
125+
// Unicorn rules
126+
"unicorn/no-null": "off",
127+
"unicorn/prefer-code-point": "off",
128+
"unicorn/prefer-string-slice": "off",
129+
"unicorn/prefer-ternary": "off",
130+
},
131+
},
132+
];

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,24 @@
2525
"devDependencies": {
2626
"@jsdevtools/ez-spawn": "^3.0.4",
2727
"@types/node": "^20.14.2",
28+
"@typescript-eslint/eslint-plugin": "^5.62.0",
29+
"@typescript-eslint/parser": "^5.62.0",
2830
"@vitejs/release-scripts": "^1.3.1",
2931
"cross-env": "^7.0.3",
3032
"esbuild": "^0.20.2",
3133
"esbuild-plugin-polyfill-node": "^0.3.0",
3234
"eslint": "^8.57.0",
3335
"eslint-config-unjs": "^0.2.1",
36+
"eslint-plugin-unicorn": "47.0.0",
37+
"eslint-plugin-vue": "^10.0.0",
3438
"ohash": "^1.1.3",
3539
"pkg-pr-new": "workspace:^",
3640
"prettier": "^3.2.5",
3741
"tsx": "^4.10.5",
3842
"typescript": "^5.4.5",
3943
"uncrypto": "^0.1.3",
4044
"vitest": "^3.0.5",
45+
"vue-eslint-parser": "^10.1.3",
4146
"wait-port": "^1.1.0"
4247
},
4348
"pnpm": {

packages/app/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false

packages/app/app/app.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default defineAppConfig({
22
ui: {
33
colors: {
4-
primary: 'sky',
4+
primary: "sky",
55
},
66
},
7-
})
7+
});

packages/app/app/app.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<script setup>
22
useHead({
33
htmlAttrs: {
4-
lang: 'en',
4+
lang: "en",
55
},
66
link: [
7-
{ rel: 'icon', href: '/favicon.png' },
8-
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' },
7+
{ rel: "icon", href: "/favicon.png" },
8+
{ rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
99
],
10-
})
10+
});
1111
1212
useSeoMeta({
13-
title: 'pkg.pr.new',
14-
description: 'Search repositories on GitHub to list their continuous releases.',
15-
})
13+
title: "pkg.pr.new",
14+
description:
15+
"Search repositories on GitHub to list their continuous releases.",
16+
});
1617
</script>
1718

1819
<template>
Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,40 @@
11
<template>
2-
<footer class="text-center p-12 opacity-50 hover:opacity-100 focus-within:opacity-100 flex flex-col items-center gap-3 text-xs">
2+
<footer
3+
class="text-center p-12 opacity-50 hover:opacity-100 focus-within:opacity-100 flex flex-col items-center gap-3 text-xs"
4+
>
35
<a href="https://stackblitz.com/" target="_blank">
4-
<img src="/stackblitz.svg" alt="StackBlitz" width="117" height="24" class="not-dark:hidden">
5-
<img src="/stackblitz-black.svg" alt="StackBlitz" width="117" height="24" class="dark:hidden">
6+
<img
7+
src="/stackblitz.svg"
8+
alt="StackBlitz"
9+
width="117"
10+
height="24"
11+
class="not-dark:hidden"
12+
/>
13+
<img
14+
src="/stackblitz-black.svg"
15+
alt="StackBlitz"
16+
width="117"
17+
height="24"
18+
class="dark:hidden"
19+
/>
620
</a>
721
<div class="flex gap-3 items-center">
8-
<div>Built by <a href="https://github.com/Aslemammad" target="_blank" class="text-primary">Aslemammad</a></div>
22+
<div>
23+
Built by
24+
<a
25+
href="https://github.com/Aslemammad"
26+
target="_blank"
27+
class="text-primary"
28+
>Aslemammad</a
29+
>
30+
</div>
931
<UIcon name="ph-dot" />
10-
<div>UI by <a href="https://github.com/Akryum" target="_blank" class="text-primary">Akryum</a></div>
32+
<div>
33+
UI by
34+
<a href="https://github.com/Akryum" target="_blank" class="text-primary"
35+
>Akryum</a
36+
>
37+
</div>
1138
</div>
1239
</footer>
1340
</template>

packages/app/app/components/CodeSnippet.vue

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
<script lang="ts" setup>
22
const props = defineProps<{
3-
code: string
4-
}>()
3+
code: string;
4+
}>();
55
6-
const { copy, isSupported } = useClipboard()
6+
const { copy, isSupported } = useClipboard();
77
8-
const toast = useToast()
8+
const toast = useToast();
99
1010
function copyCode() {
11-
copy(props.code)
11+
copy(props.code);
1212
toast.add({
13-
title: 'Copied to clipboard',
14-
color: 'success',
15-
icon: 'ph-check',
16-
})
13+
title: "Copied to clipboard",
14+
color: "success",
15+
icon: "ph-check",
16+
});
1717
}
1818
</script>
1919

2020
<template>
2121
<div class="relative group">
22-
<pre class="text-white bg-gray-500 dark:bg-black rounded-lg p-6"><code>{{ props.code }}</code></pre>
22+
<pre
23+
class="text-white bg-gray-500 dark:bg-black rounded-lg p-6"
24+
><code>{{ props.code }}</code></pre>
2325

2426
<ClientOnly>
25-
<UTooltip
26-
v-if="isSupported"
27-
text="Copy to clipboard"
28-
>
27+
<UTooltip v-if="isSupported" text="Copy to clipboard">
2928
<UButton
3029
icon="ph-clipboard"
3130
class="absolute top-2 right-2 not-group-hover:hidden"

0 commit comments

Comments
 (0)