Skip to content

How to use Nuxt + Eslint in a monorepo? #420

Answered by dsvgl
BenJackGill asked this question in Q&A
Discussion options

You must be logged in to vote

@BenJackGill We currently do it similar as mentioned here: eslint/eslint#16960 (comment)

We use pnpm workspaces and have a separate "package" that defines basic presets, plugins and custom rules.

We export two config arrays.

One is just an array of presets etc that is used with the special withNuxt function inside eslint.config.js when inside a nuxt app – this eg. makes ESLint not complaining about multi-word name for layout and pages files.

The other export uses createConfigForNuxt from @nuxt/eslint-config/flat directly where the export happens. This config can then be used inside eslint.config.js of packages that are not nuxt apps (eg. an utils only package). We basically inherit all th…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@dsvgl
Comment options

@BenJackGill
Comment options

@dsvgl
Comment options

@RodrigoCarvalhoCode
Comment options

@BenJackGill
Comment options

Answer selected by BenJackGill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants