Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to eslint v9 #81

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

5 changes: 0 additions & 5 deletions .eslintrc

This file was deleted.

15 changes: 15 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// @ts-check
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'

export default createConfigForNuxt({
features: {
tooling: true,
stylistic: true,
},
dirs: {
src: [
'./playground-nuxt2',
'./playground',
],
},
})
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
"dev": "nuxt dev playground",
"dev:build": "nuxt build playground",
"lint": "eslint --ext .ts .",
"lint": "eslint .",
"release": "pnpm test && pnpm build && standard-version && npm publish && git push --follow-tags",
"test": "pnpm lint"
},
Expand All @@ -44,13 +44,13 @@
},
"devDependencies": {
"@nuxt/module-builder": "^0.3.1",
"@nuxtjs/eslint-config-typescript": "^12.0.0",
"eslint": "^8.40.0",
"eslint": "^9.1.1",
"nuxt": "^3.5.0",
"standard-version": "^9.5.0",
"typescript": "^5.0.4"
"typescript": "^5.0.4",
"@nuxt/eslint-config": "^0.3.9"
},
"resolutions": {
"@nuxtjs/web-vitals": "link:."
}
}
}
13 changes: 8 additions & 5 deletions playground-nuxt2/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<div>
Metrics:
<ul>
<li v-for="(event, index) of events" :key="index">
<li
v-for="(event, index) of events"
:key="index"
>
[{{ event.metric.name }}] {{ event.context.fullPath }} {{ event.metric.value }} ({{ event.date.toUTCString() }})
</li>
</ul>
Expand All @@ -15,16 +18,16 @@

<script>
export default {
data () {
data() {
return {
events: []
events: [],
}
},
mounted () {
mounted() {
window.onVitalEvent && window.onVitalEvent((event) => {
this.events.unshift(event)
this.events = this.events.splice(0, 3 * 4)
})
}
},
}
</script>
6 changes: 3 additions & 3 deletions playground-nuxt2/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default {
buildModules: [
require('..')
require('..'),
],
webVitals: {
debug: true
}
debug: true,
},
// googleAnalytics: {
// id: 'hello'
// }
Expand Down
13 changes: 8 additions & 5 deletions playground/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<div>
Metrics:
<ul>
<li v-for="(event, index) of events" :key="index">
<li
v-for="(event, index) of events"
:key="index"
>
[{{ event.metric.name }}] {{ event.context.fullPath }} {{ event.metric.value }} ({{ event.date.toUTCString() }})
</li>
</ul>
Expand All @@ -15,16 +18,16 @@

<script>
export default {
data () {
data() {
return {
events: []
events: [],
}
},
mounted () {
mounted() {
window.onVitalEvent && window.onVitalEvent((event) => {
this.events.unshift(event)
this.events = this.events.splice(0, 3 * 4)
})
}
},
}
</script>
6 changes: 3 additions & 3 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export default defineNuxtConfig({
modules: [
'../src/module'
'../src/module',
],
webVitals: {
// provider: 'log',
api: { url: '/api/web-vitals' },
// ga: { id: 123 },
// gtm: {},
debug: true
}
debug: true,
},
})
Loading
Loading