Skip to content
Discussion options

You must be logged in to vote

You’re really close!
The issue is that withNuxt() expects an array of ESLint flat configs, while @unocss/eslint-config/flat exports a single config object — which is not iterable. So spreading it like ...unocss causes the [Symbol.iterator] error.

Just pass it inside an array instead:

// @ts-check
import withNuxt from "./.nuxt/eslint.config.mjs";
import unocss from "@unocss/eslint-config/flat";

export default withNuxt([
  unocss,
  {
    rules: {
      // Example custom rule
      "vue/html-self-closing": "off",
    },
  },
]);

After wrapping it in an array, UnoCSS ESLint works correctly with Nuxt’s flat config.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by chuckntaylor
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