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

fix: set basedir for plugin resolution #469

Merged
1 commit merged into from
May 27, 2024
Merged

fix: set basedir for plugin resolution #469

1 commit merged into from
May 27, 2024

Conversation

ghost
Copy link

@ghost ghost commented May 22, 2024

See: https://dhis2.atlassian.net/browse/DHIS2-16776 and https://stylelint.io/user-guide/cli#--config-basedir

I've tried to replicate the existing approach as much as possible, mostly eslint. Usually you'd run stylelint from the root of the project and pass it a glob or list of relative filenames.

What we do is set the cwd to where cli-style is installed in node_modules, then we call the stylelint binary (by its absolute path) and pass it the files it should lint as absolute paths. This is not just confusing for humans but also for stylelint. So to help it find the plugins it needs we need to set --config-basedir to the cwd (cwd being PACKAGE_ROOT, not process.cwd())

@ghost ghost marked this pull request as ready for review May 23, 2024 10:27
@ghost ghost merged commit 83e8d43 into master May 27, 2024
15 checks passed
@ghost ghost deleted the add-basedir branch May 27, 2024 07:25
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 10.7.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants