Skip to content

@unocss/eslint-config doesn't work on pnpm monorepo with vscode? #2603

@Geddard

Description

@Geddard

UnoCSS version

any

Describe the bug

I'm trying to use the eslint plugin for unocss, the older one from devunt doesn't have the options to configure linting for other attributes besides className so i was trying to use the tailwind one, but the latter doesn't pick up the uno.config.ts custom values.

I installed @unocss/eslint-config and tried following the official instructions but when i open a file with unocss classes i get an error like this for ESlint output.

[Error - 12:38:47] An unexpected error occurred:
[Error - 12:38:47] Error: [@unocss/eslint-plugin] No config file found, create a `uno.config.ts` file in your project root and try again.
    at getGenerator (/---/uno-monorepo/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@unocss/eslint-plugin/dist/worker-sort.cjs:37:11)
    at async /---/uno-monorepo/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@unocss/eslint-plugin/dist/worker-sort.cjs:43:15

Reproduction

I've uploaded a reproduction repo, these are the steps to reproduce:

Repo link

  1. clone the repo
  2. run pnpm install
  3. open a .tsx file, page.tsx has unocss class applied or apply a class to a new file
  4. observe the eslint output for vscode

Screenshot:

Screenshot 2023-05-10 at 12 48 25

System Info

  • laptop: MacBook Air M1 13 inches
  • OS: Ventura latest version
  • IDE: VScode
  • Package Manager: pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions