Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ferferga opened this issue Oct 14, 2024 · 2 comments
Open

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

ferferga opened this issue Oct 14, 2024 · 2 comments

Comments

@ferferga
Copy link

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

  • Using TypeScript configuration files with jiti v2. Looks like that is already covered
  • A monorepo (called @jellyfin-vue/configs in my case) where TypeScript modules export factory functions for rule configs.
  • Those factory functions are imported in frontend/eslint.config.ts, working perfectly with ESLint but not with the inspector.
@voxpelli
Copy link
Contributor

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
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants