Skip to content

Commit fdd66a0

Browse files
authored
chore: migrate to eslint v9 (#81)
1 parent 8e600a1 commit fdd66a0

20 files changed

+5238
-4320
lines changed

.eslintignore

-3
This file was deleted.

.eslintrc

-5
This file was deleted.

eslint.config.mjs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @ts-check
2+
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
3+
4+
export default createConfigForNuxt({
5+
features: {
6+
tooling: true,
7+
stylistic: true,
8+
},
9+
dirs: {
10+
src: [
11+
'./playground-nuxt2',
12+
'./playground',
13+
],
14+
},
15+
})

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
3232
"dev": "nuxt dev playground",
3333
"dev:build": "nuxt build playground",
34-
"lint": "eslint --ext .ts .",
34+
"lint": "eslint .",
3535
"release": "pnpm test && pnpm build && standard-version && npm publish && git push --follow-tags",
3636
"test": "pnpm lint"
3737
},
@@ -44,13 +44,13 @@
4444
},
4545
"devDependencies": {
4646
"@nuxt/module-builder": "^0.3.1",
47-
"@nuxtjs/eslint-config-typescript": "^12.0.0",
48-
"eslint": "^8.40.0",
47+
"eslint": "^9.1.1",
4948
"nuxt": "^3.5.0",
5049
"standard-version": "^9.5.0",
51-
"typescript": "^5.0.4"
50+
"typescript": "^5.0.4",
51+
"@nuxt/eslint-config": "^0.3.9"
5252
},
5353
"resolutions": {
5454
"@nuxtjs/web-vitals": "link:."
5555
}
56-
}
56+
}

playground-nuxt2/layouts/default.vue

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
<div>
66
Metrics:
77
<ul>
8-
<li v-for="(event, index) of events" :key="index">
8+
<li
9+
v-for="(event, index) of events"
10+
:key="index"
11+
>
912
[{{ event.metric.name }}] {{ event.context.fullPath }} {{ event.metric.value }} ({{ event.date.toUTCString() }})
1013
</li>
1114
</ul>
@@ -15,16 +18,16 @@
1518

1619
<script>
1720
export default {
18-
data () {
21+
data() {
1922
return {
20-
events: []
23+
events: [],
2124
}
2225
},
23-
mounted () {
26+
mounted() {
2427
window.onVitalEvent && window.onVitalEvent((event) => {
2528
this.events.unshift(event)
2629
this.events = this.events.splice(0, 3 * 4)
2730
})
28-
}
31+
},
2932
}
3033
</script>

playground-nuxt2/nuxt.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export default {
22
buildModules: [
3-
require('..')
3+
require('..'),
44
],
55
webVitals: {
6-
debug: true
7-
}
6+
debug: true,
7+
},
88
// googleAnalytics: {
99
// id: 'hello'
1010
// }

playground/app.vue

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
<div>
66
Metrics:
77
<ul>
8-
<li v-for="(event, index) of events" :key="index">
8+
<li
9+
v-for="(event, index) of events"
10+
:key="index"
11+
>
912
[{{ event.metric.name }}] {{ event.context.fullPath }} {{ event.metric.value }} ({{ event.date.toUTCString() }})
1013
</li>
1114
</ul>
@@ -15,16 +18,16 @@
1518

1619
<script>
1720
export default {
18-
data () {
21+
data() {
1922
return {
20-
events: []
23+
events: [],
2124
}
2225
},
23-
mounted () {
26+
mounted() {
2427
window.onVitalEvent && window.onVitalEvent((event) => {
2528
this.events.unshift(event)
2629
this.events = this.events.splice(0, 3 * 4)
2730
})
28-
}
31+
},
2932
}
3033
</script>

playground/nuxt.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
export default defineNuxtConfig({
22
modules: [
3-
'../src/module'
3+
'../src/module',
44
],
55
webVitals: {
66
// provider: 'log',
77
api: { url: '/api/web-vitals' },
88
// ga: { id: 123 },
99
// gtm: {},
10-
debug: true
11-
}
10+
debug: true,
11+
},
1212
})

0 commit comments

Comments
 (0)