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

isInEditor not working in IntelliJ IDEA: process.env.JETBRAINS_IDE not found #651

Open
5 of 7 tasks
plehnen opened this issue Jan 8, 2025 · 0 comments
Open
5 of 7 tasks

Comments

@plehnen
Copy link

plehnen commented Jan 8, 2025

Describe the bug

I just migrated to @antfu/eslint-config and I am really excited about it.

But I noticed that in IntelliJ IDEA the isInEditorEnv is returning false during auto fix on save.
It seems that there is no such env variable "JETBRAINS_IDE". At least in the latest version: IntelliJ IDEA 2024.3.1.1 (Ultimate Edition) Build #IU-243.22562.218, built on December 18, 2024

Or is there something I need to activate first?
I also didn't find a way to pass this env variable to the eslint command. it is only possible to add extra eslint options.

I will try to find a workaround (it seems that when eslint is executed by the IDE the env variables "COLORTERM", "DEBUG_COLORS", "FORCE_COLOR", "MOCHA_COLORS", "npm_config_color" are set, but I don't know how reliable that is on other machines).

If you have any tips on how to detect eslint is executed by IntelliJ IDEA I would love to hear them.

Reproduction

//node

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (32) x64 Intel(R) Core(TM) i9-14900HX
    Memory: 33.03 GB / 63.71 GB
  Binaries:
    Node: 22.5.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.15.2 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (131.0.2903.70)
    Internet Explorer: 11.0.26100.1882

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
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

1 participant