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: eslint should replace dashes for underscore #81

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

hanoii
Copy link
Contributor

@hanoii hanoii commented Oct 7, 2024

Same as symlink-project

@weitzman weitzman merged commit 241e70e into ddev:main Oct 10, 2024
2 checks passed
hanoii added a commit to hanoii/ddev-drupal-contrib that referenced this pull request Oct 10, 2024
@hanoii hanoii deleted the eslint-fix branch October 21, 2024 11:59
@claudiu-cristea
Copy link
Contributor

@weitzman this bug is breaking with modules having underscore(s) in name. Could you, please, cut a release to benefit for the fix?

@rfay
Copy link
Member

rfay commented Oct 28, 2024

@claudiu-cristea Are you using a recent DDEV? Since v1.23.4, DDEV automatically uses dashes for the project name.

@hanoii
Copy link
Contributor Author

hanoii commented Oct 28, 2024

@rfay I think the problem is a different one, he meant that with the project using dashes, the eslint command failed because of that, as the module is with underscores, so we are changing it to underscores now.

He just need a new release of the addon.

@hanoii
Copy link
Contributor Author

hanoii commented Oct 28, 2024

It's what this PR fixes

@claudiu-cristea
Copy link
Contributor

claudiu-cristea commented Oct 28, 2024

Anyway, I don't think this solution is 100% safe. What if the module name is just_a_module but the developer decides to name the project my-proj? The whole logic goes away

@hanoii
Copy link
Contributor Author

hanoii commented Oct 28, 2024

I am pretty sure nothing will happen. The symlink command will symlink your modules' files into a my_proj directory and will work the same

https://www.drupal.org/docs/develop/creating-modules/naming-and-placing-your-drupal-module#s-create-a-folder-for-your-module

Note that it is not necessary to use the same name for your module's folder as your machine name. You could, for example, use the folder name HelloWorld instead. However, you must remember to use the machine name programmatically within your module's code and filenames.

The logic remains solid, we might as well add a test for that though. Feel free to

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

Successfully merging this pull request may close these issues.

4 participants