eslint / config-inspector

A visual tool for inspecting and understanding your ESLint flat configs.
https://www.npmjs.com/package/@eslint/config-inspector
Apache License 2.0
730 stars 19 forks source link

Imported TypeScript files in ``eslint.config.ts`` doesn't work #95

Open ferferga opened 1 month ago

ferferga commented 1 month ago

The following structure is publicily available at https://github.com/jellyfin/jellyfin-vue

Steps to reproduce

  1. Click on Code > Create codespace from master (or clone the repository locally)
  2. cd frontend && npm run lint:inspect

Description

This an overview of the setup

voxpelli commented 3 weeks ago

I have a hard time understanding what it is that doesn’t work.

Can you maybe add a screenshot or something where you show what’s wrong or missing?

ferferga commented 3 weeks ago

@voxpelli I was able to better triage the issue and create a minimal reproduction: https://stackblitz.com/edit/vitejs-vite-9abzaz

Steps to reproduce

  1. cd packages/configs and run npm run lint:inspect
  2. ESLint config inspector will load successfully, since the TypeScript file imported is referenced from the same project
  3. Change to the packages/main directory and run npm run lint:inspect there. The config inspector will fail to load with the following error, since the base rules are being imported from the monorepo: Image

Additional context

It looks like the issue exists when importing .ts files from node_modules in monorepo setups. Similar to what happens in Vite. Hence, the workarounds listed there are also applicable to this project