Skip to content

Commit

Permalink
fix(module): config creation, fix #346
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 20, 2024
1 parent 114916f commit 2bd835b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@nuxt/eslint-plugin": "workspace:*",
"@nuxt/kit": "^3.11.1",
"chokidar": "^3.6.0",
"eslint-flat-config-viewer": "^0.1.12",
"eslint-flat-config-viewer": "^0.1.13",
"get-port-please": "^3.1.2",
"pathe": "^1.1.2",
"unimport": "^3.7.1"
Expand Down
6 changes: 5 additions & 1 deletion packages/module/src/modules/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ import { ConfigGenOptions, ModuleOptions } from '../module'
import { createAddonGlobals } from '../config-addons/globals'

export async function setupConfigGen(options: ModuleOptions, nuxt: Nuxt) {
const defaultAddons = [
createAddonGlobals(nuxt),
]

addTemplate({
filename: 'eslint.config.mjs',
write: true,
async getContents() {
const addons: ESLintConfigGenAddon[] = [
createAddonGlobals(nuxt),
...defaultAddons,
]
await nuxt.callHook('eslint:config:addons', addons)
return generateESLintConfig(options, nuxt, addons)
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2bd835b

Please sign in to comment.