PHPstorm indicated stylelint configuration errors that can be fixed as I've noted here.

Steps to reproduce

When editing module or theme code using PHPstorm, errors indicating flawed Stylelint configurations would pop-up when subtheming Radix until I made the following changes, to include a PHPstorm configuration. Then it was possible to write theme code without stress.

This fix also addresses this issue.

Proposed resolution

Once this issue has been created and saved, I'll submit a patch. The patch simply changes this line from:
"extends": "stylelint-config-standard",
to
"extends": ["stylelint-config-standard"],
It is important to point out at this point, it is still important to run npm install from the web/core directory, and complete further steps as I have documented here.

Remaining tasks

Test the submitted changes.

Release notes snippet

The web/core directory has the requisite NPM modules for linting code. Click this for more information.

Issue fork drupal-3240229

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Amstercad created an issue. See original summary.

amstercad’s picture

Issue summary: View changes
amstercad’s picture

Issue summary: View changes
amstercad’s picture

Issue summary: View changes
longwave’s picture

Category: Bug report » Task
Status: Active » Needs review

The stylelint docs say that either a string or an array is acceptable for extends: https://stylelint.io/user-guide/configure/#extends

I guess we can change this to satisfy PHPStorm, although it feels like a PHPStorm bug if it is complaining about valid config. I don't think this should be classified as a Drupal bug.

longwave’s picture

Issue tags: +Bug Smash Initiative

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

siliconmeadow’s picture

Hi @Amstercad,

Are you sure this is not something specific to Radix? The reason I ask is that I just did a clean install of 9.3 while starting on a new project and saw the stylelint message in PhpStorm. I followed your instructions for installing yarn at web/core, and the messages went away magically without applying this patch.

I'm using PhpStorm 2021.3, btw.

amstercad’s picture

Status: Needs review » Fixed

Greetings @siliconmeadow, I agree with you, and yarn seems to be what the cool kids are using now. In fact I forgot about this particular bug report until I received your reply just now.

However I have been doing my best to keep to Composer docs up-to-date as you can see by that page's edit history. Because Drupal 9.3 has been released and using yarn resolves the issue with PHPstorm I am now closing this bug report with the status of 'fixed'.

I am also using the latest PHPstorm, and switching to this tool was one of the best things I did this past year. Happy New Year.

amstercad’s picture

Actually, since yarn seems to be a thing with Drupal core now, this technical document may need elevation to drupal.org's formal documentation. I'm posting the suggestion here for others to potentially weigh in. It requires webpack also, (which I prefer to use anyway). That might be a deal breaker for some.

siliconmeadow’s picture

Thank you very much for your help @Amstercad - the documentation has certainly helped me. Perhaps you could open a new issue in the Documentation project here https://drupal.org/node/add/project-issue/documentation , as I suspect your concern mentioned in this issue will be simply lost here due the issue is considered "fixed" from a status point of view. :-)

All the best,

Richard

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.