Skip to content

Commit d62e100

Browse files
committed
chore: Fix lint and lint project
1 parent d84c3d0 commit d62e100

12 files changed

Lines changed: 381 additions & 415 deletions

.eslintrc.cjs

Lines changed: 0 additions & 19 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

app/pages/[slug].vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { ContentRenderer } from '#components';
1616
import variables from '@/utilities/variables';
1717
1818
const $route = useRoute()
19-
const config = useRuntimeConfig()
2019
2120
const path = $route.path.endsWith('/') ? $route.path.slice(0, -1) : $route.path
2221
const { data: page } = await useAsyncData(path, () => {

app/pages/index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
import ProjectList from '@/components/ProjectList.vue'
6565
import variables from '@/utilities/variables';
6666
67-
const config = useRuntimeConfig()
68-
6967
useHead({
7068
link: [
7169
{ rel: 'canonical', href: `https://jackdomleo.dev` }

app/pages/links.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
<script lang="ts" setup>
2020
import variables from '@/utilities/variables';
2121
22-
const config = useRuntimeConfig()
23-
2422
useSeoMeta({
2523
title: 'Links'
2624
})

app/pages/projects.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import ProjectList from '@/components/ProjectList.vue';
1717
import variables from '@/utilities/variables';
1818
19-
const config = useRuntimeConfig()
20-
2119
useSeoMeta({
2220
title: 'Projects'
2321
})

app/pages/work.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@
184184
<script lang="ts" setup>
185185
import variables from '@/utilities/variables'
186186
187-
const config = useRuntimeConfig()
188-
189187
useSeoMeta({
190188
title: 'Work'
191189
})

content.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineContentConfig, defineCollection, z } from '@nuxt/content'
1+
import { defineContentConfig, defineCollection } from '@nuxt/content'
22
import { asSitemapCollection } from '@nuxtjs/sitemap/content'
33

44
export default defineContentConfig({

eslint.config.js

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import tsPlugin from '@typescript-eslint/eslint-plugin'
2+
import tsParser from '@typescript-eslint/parser'
3+
import vuePlugin from 'eslint-plugin-vue'
4+
import vitestPlugin from '@vitest/eslint-plugin'
5+
6+
export default [
7+
// Global ignores (replaces --ignore-path .gitignore)
8+
{
9+
ignores: [
10+
'node_modules/**',
11+
'**/*.log*',
12+
'.nuxt/**',
13+
'.nitro/**',
14+
'.cache/**',
15+
'.output/**',
16+
'.env',
17+
'.data/**',
18+
'dist/**',
19+
'coverage/**',
20+
'.eslintcache',
21+
],
22+
},
23+
24+
// Vue flat config (sets up vue-eslint-parser + vue rules for .vue files)
25+
...vuePlugin.configs['flat/essential'],
26+
27+
// JS / TS files: use TypeScript parser directly (vue-eslint-parser is overridden here)
28+
{
29+
files: ['**/*.{js,ts}'],
30+
languageOptions: {
31+
parser: tsParser,
32+
parserOptions: {
33+
sourceType: 'module',
34+
ecmaVersion: 'latest',
35+
},
36+
},
37+
},
38+
39+
// JS / TS / Vue files config
40+
{
41+
files: ['**/*.{js,ts,vue}'],
42+
plugins: {
43+
'@typescript-eslint': tsPlugin,
44+
},
45+
languageOptions: {
46+
parserOptions: {
47+
// TypeScript parser delegated from vue-eslint-parser for <script> blocks
48+
parser: tsParser,
49+
sourceType: 'module',
50+
ecmaVersion: 'latest',
51+
ecmaFeatures: { jsx: true },
52+
},
53+
globals: {
54+
// Browser
55+
window: 'readonly',
56+
document: 'readonly',
57+
navigator: 'readonly',
58+
console: 'readonly',
59+
setTimeout: 'readonly',
60+
clearTimeout: 'readonly',
61+
setInterval: 'readonly',
62+
clearInterval: 'readonly',
63+
fetch: 'readonly',
64+
URL: 'readonly',
65+
URLSearchParams: 'readonly',
66+
// Node
67+
process: 'readonly',
68+
__dirname: 'readonly',
69+
__filename: 'readonly',
70+
require: 'readonly',
71+
module: 'readonly',
72+
exports: 'readonly',
73+
},
74+
},
75+
rules: {
76+
// TypeScript recommended rules
77+
...tsPlugin.configs.recommended.rules,
78+
79+
// TypeScript overrides (equivalent to @nuxtjs/eslint-config-typescript)
80+
'@typescript-eslint/no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }],
81+
'no-unused-vars': 'off',
82+
'no-undef': 'off',
83+
'@typescript-eslint/ban-ts-comment': 'off',
84+
'@typescript-eslint/consistent-indexed-object-style': 'off',
85+
'@typescript-eslint/naming-convention': 'off',
86+
'@typescript-eslint/explicit-function-return-type': 'off',
87+
'@typescript-eslint/explicit-member-accessibility': 'off',
88+
'@typescript-eslint/no-explicit-any': 'off',
89+
'@typescript-eslint/no-empty-interface': 'off',
90+
91+
// Project-specific overrides
92+
'vue/multi-word-component-names': 'off',
93+
'vue/no-v-html': 'off',
94+
},
95+
},
96+
97+
// Vitest test files
98+
{
99+
files: ['**/*.test.{js,ts}', '**/*.spec.{js,ts}'],
100+
plugins: {
101+
vitest: vitestPlugin,
102+
},
103+
rules: {
104+
...vitestPlugin.configs.recommended.rules,
105+
},
106+
},
107+
]

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dev": "nuxi dev --open",
1717
"generate": "nuxi generate -m",
1818
"preview": "nuxi preview",
19-
"lint": "eslint --ext \".js,.ts,.vue\" --ignore-path .gitignore --max-warnings=0 --cache --fix .",
19+
"lint": "eslint --max-warnings=0 --cache --fix .",
2020
"test": "rimraf ./coverage && vitest run --pass-with-no-tests",
2121
"test:report": "open-cli coverage/index.html"
2222
},
@@ -41,11 +41,10 @@
4141
"@typescript-eslint/eslint-plugin": "^8.56.0",
4242
"@typescript-eslint/parser": "^8.56.0",
4343
"@vitest/coverage-v8": "^4.0.18",
44+
"@vitest/eslint-plugin": "^1.6.9",
4445
"@vue/test-utils": "^2.4.6",
45-
"eslint": "^9.39.3",
46-
"eslint-config-prettier": "^10.1.8",
46+
"eslint": "^10.0.1",
4747
"eslint-plugin-nuxt": "^4.0.0",
48-
"eslint-plugin-vitest": "^0.5.4",
4948
"eslint-plugin-vue": "^10.8.0",
5049
"happy-dom": "^20.7.0",
5150
"nuxt": "^4.3.1",
@@ -58,6 +57,7 @@
5857
"type-fest": "^5.4.4",
5958
"typescript": "^5.9.3",
6059
"vitest": "^4.0.18",
60+
"vue-eslint-parser": "^10.4.0",
6161
"vue-tsc": "^3.2.5"
6262
},
6363
"engines": {

0 commit comments

Comments
 (0)