Skip to content

Custom config file path #156

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

Closed
aparajita opened this issue Apr 18, 2025 · 4 comments · Fixed by #172
Closed

Custom config file path #156

aparajita opened this issue Apr 18, 2025 · 4 comments · Fixed by #172
Assignees

Comments

@aparajita
Copy link

Oxc 0.0.2
IntelliJ IDEA 2025.1 (Ultimate Edition)

Thank you for this plugin!

Currently the config file must be named .oxlintrc.json. It would be nice if we could specify the path to the config file. For example, in my case I use the name oxlint.config.jsonc, which is a more modern naming scheme consistent with eslint and many other tools. I use .jsonc so that the IDE doesn't complain about comments in the file.

@nrayburn-tech
Copy link
Collaborator

If you're just looking for the equivalent of running something like this from the CLI npx oxlint --config=oxlint.config.jsonc then you can configure the plugin manually. Does the below configuration resolve your issue?

I'm using relative paths below, but I think you might need to use absolute paths when configuring this in your settings.
Language Server: ./sandbox/node_modules/@oxlint/darwin-arm64/oxc_language_server (will vary based on your platform)
Config: ./sandbox/.oxlintrc.json
Image

@aparajita
Copy link
Author

I tried that, it doesn't work, that's why I filed the issue. Sorry, I should have mentioned that.

Apparently your plugin is only saving the directory of whatever is entered in the config file path field. If you reopened the Settings in the example you gave, you would see the path ends with "sandbox".

If in fact you were to support the path to the actual config file, be sure to change the field label to "Path to config file".

@nrayburn-tech
Copy link
Collaborator

Ahh, ok I’ll investigate it.

@nrayburn-tech
Copy link
Collaborator

The issue is more complicated than I thought it was going to be.

  1. The config file directory is saved instead of the specific config file path.
  2. The project root is determined based on the .oxlintrc.json file path, which is only applicable when using nested configs. When specifying a config file path, the project root should probably be the location of the nearest package.json.
  3. When specifying a config file path, it looks like the oxlint executable is used instead of the oxc_language_server. Not sure why this is the case or what the impact of this may be.

ESLint screenshot below, we may need something more similar to this for manual configuration.
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment