8000 chore: migrate to eslint v9 by danielroe · Pull Request #250 · nuxt/module-builder · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: migrate to eslint v9 #250

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

Merged
merged 4 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.

4 changes: 2 additions & 2 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export default defineBuildConfig({
declaration: true,
entries: [
'./src/cli',
'./src/index'
]
'./src/index',
],
})
15 changes: 15 additions & 0 deletions eslint.config.js
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: [
'./example',
'./example/playground',
],
},
})
6 changes: 3 additions & 3 deletions example/playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ export default defineNuxtConfig({
myModule: {
apiKey: '',
// @ts-expect-error invalid configuration key
api: ''
api: '',
},
hooks: {
'my-module:init' () {}
}
'my-module:init'() {},
},
})
10 changes: 5 additions & 5 deletions example/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ModuleHooks {
}

export interface ModuleRuntimeHooks {
'my-module:runtime-hook': any
'my-module:runtime-hook': () => void
}

export interface ModulePublicRuntimeConfig {
Expand All @@ -24,16 +24,16 @@ export interface ModuleRuntimeConfig {
export default defineNuxtModule<ModuleOptions>({
meta: {
name: 'my-module',
configKey: 'myModule'
configKey: 'myModule',
},
// Default configuration options of the Nuxt module
defaults: {
apiKey: ''
apiKey: '',
},
setup (_options, _nuxt) {
setup(_options, _nuxt) {
const resolver = createResolver(import.meta.url)

// Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack`
addPlugin(resolver.resolve('./runtime/plugin'))
}
},
})
5 changes: 2 additions & 3 deletions example/src/runtime/plugin.ts
ED4F
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import type { Plugin } from 'nuxt/app'
import { defineNuxtPlugin } from '#imports'

export default defineNuxtPlugin(() => {
// eslint-disable-next-line no-console
console.log('Plugin injected by my-module!')
return {
provide: {
injection: 'injected' as const
}
injection: 'injected' as const,
},
}
}) as Plugin<{ injection: 'injected' }>
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"build": "unbuild",
"dev:prepare": "pnpm -r dev:prepare",
"example:build": "pnpm nuxt-module-build build ./example",
"lint": "eslint --ext .ts,.js,.mjs .",
"lint": "eslint .",
"nuxt-module-build": "JITI_ESM_RESOLVE=1 jiti ./src/cli.ts",
"prepack": "pnpm build",
"release": "pnpm vitest run && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
Expand All @@ -45,20 +45,20 @@
"devDependencies": {
"@nuxt/kit": "^3.11.2",
"@nuxt/schema": "^3.11.2",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@types/node": "^20.12.7",
"@vitest/coverage-v8": "^1.5.0",
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
"eslint": "^9.1.0",
"jiti": "^1.21.0",
"nuxi": "^3.11.1",
"nuxt": "^3.11.2",
"vue": "^3.4.24",
"vitest": "^1.5.0"
"vitest": "^1.5.0",
"@nuxt/eslint-config": "^0.3.9"
},
"resolutions": {
"@nuxt/kit": "^3.11.2",
"@nuxt/schema": "^3.11.2",
"vue": "^3.4.24"
}
}
}
Loading
0