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

Resolve importFrom relative to config file, not working directory #41

Closed
silverwind opened this issue Mar 24, 2024 · 4 comments
Closed

Comments

@silverwind
Copy link
Contributor

In a monorepo with a .stylelintrc.yaml in a subdirectory I'm getting errors from my editor integration because this plugin resolves files relative to working directory instead of relative to the config file. I'd suggest to always resolve paths relative to the config file. This is how pretty much all other linters work too.

In case this suggestion is not possible, you could introduce a <rootDir> option like jest also has, e.g. <rootDir>/style.css to specify the path relative to the config file.

@romainmenke
Copy link
Member

Better to solve this after there is a "core" solution.

See : stylelint/stylelint#4088

@silverwind
Copy link
Contributor Author

Yes indeed. But until then, this nice plugin is unusable for me 😢. If stylelint plugins have access to the config file path where the plugin's options are set, it shouldn't be too hard of a feature to add.

@romainmenke
Copy link
Member

PR's are welcome :)

@silverwind
Copy link
Contributor Author

I guess I will go another route and just pass absolute paths to the plugin. This means I have to migrate my config from yaml to js, but that will be worth it anyways.

@silverwind silverwind closed this as not planned Won't fix, can't repro, duplicate, stale Mar 26, 2024
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