Jardinero / stylelint-plugin

Stylelint plugin for all products based on IntelliJ Platform (IntelliJ IDEA, RubyMine, WebStorm, PhpStorm, PyCharm, AppCode, etc.)
MIT License
20 stars 4 forks source link

Auto detect stylelint executable #11

Closed roelofr closed 3 years ago

roelofr commented 6 years ago

Hey,

I've taken the liberty to perform a serious overhaul on one aspect of the code: the way the stylelint binary is detected.

Now the plugin automatically looks in four places for the binary:

  1. The node_modules directory in the project root
  2. The globally installed npm modules (via npm install -g stylelint)
  3. The user-globally installed Yarn packges (via yarn global add stylelint)
  4. The $PATH variable

Items 2 and 3 use npm bin -g and yarn global bin respectively to determine where to look (those commands return the absolute path to the binaries directory) and the 1st item just checks for a node_modules/.bin directory. So that's a fix for #9.

It auto-adds .cmd to files on Windows, but shouldn't do that on Linux or Mac (so this fixes #3), should actually work with a previous commit, I just re-located the code into the executable package.

If a user has manually specified the path to stylelint, it's still being used and will disable the auto-check for files. To inform users of that fact I added a notice on the settings page and also added those strings to a resources file, so they can be translated (I translated them in Dutch for you already :wink:).

And I've added/edited some files that should make editing code more monogamous (.editorconfig) and will show off the plugin a lot better (the README.md)


WARNING I was not able to get it to test properly and the JetBrains docs are all but clear about that, so I don't actually know how stable it works... :confused:

mdodge-ecgrow commented 4 years ago

Thanks for this update. Now how do I replace my installed version with this version?

roelofr commented 4 years ago

The owner of this repo needs to merge it, but it hasn't been merged yet.

mdodge-ecgrow commented 4 years ago

He/She doesn't appear to be too active, what happens if they never merge? Can we create a different plugin?

roelofr commented 4 years ago

Nothing really, it just doesn't get released.

I no longer use IntelliJ or PHPStorm and no longer have the required licenses to use it, so I cannot help you any further.

Just a reminder: you're replying on a PR that was opened on 2018-11-27.