linter-stylelint icon indicating copy to clipboard operation
linter-stylelint copied to clipboard

Instructions slightly unclear

Open DamSenViet opened this issue 7 years ago • 7 comments

Add a stylelint section in your package.json.

I've tried modifying the package.json (belonging to linter-stylelint) but when I attempt to reload Atom, it fails to load the package. I feel like I may be doing this wrong, would you mind showing me an example of the implementation?

I am very confused rn. Am I even modifying the right file?

Is this only for node package developers?

I'm just looking for a way to alter the global settings so I can share config settings between projects without having to continuously make .stylelintrc.json in every single project.

DamSenViet avatar Feb 24 '18 09:02 DamSenViet

I also would love a little more direction here, I've added an indentation override to my ~/.atom/packages/linter-stylelint/package.json file but while I don't get any errors it doesn't appear to be picking up on the setting. I'm not sure if I'm putting it in the wrong place or I'm not setting it properly.

I tried it two ways:

  ...
  "version": "4.2.0",
  "stylelint": {
    "indentation": "tab",
    "rules": {
        "indentation": "tab"
    }
  }
}

An example package.json file with working stylelint rules defined would be great!

ChristinWhite avatar Feb 28 '18 20:02 ChristinWhite

This package is meant to be a wrapper around stylelint, you should follow their configuration guide in order to set things up.

Arcanemagus avatar Mar 01 '18 00:03 Arcanemagus

Am I misunderstanding then that you can't extend the standard config built into stylelint (assuming useStandard is true)? I'd like to have a slightly customized basic setup I can use to edit quick one-off files that don't need the full Node project infrastructure.

ChristinWhite avatar Mar 01 '18 03:03 ChristinWhite

The "Use Standard" option enables the stylelint-config-standard configuration when no other configuration is found. If you want to customize that your best bet is to simply place a configuration file above where you have all of your projects, since stylelint searches all parent directories before giving up.

Arcanemagus avatar Mar 01 '18 03:03 Arcanemagus

Thanks!

ChristinWhite avatar Mar 01 '18 03:03 ChristinWhite

That's not necessarily shared unless all of our projects are in one place (which most of the time they're not). I've gone through the style-lint documentation but I can't seem to find anyone who's been able to set up a shared extension of the standard rules.

DamSenViet avatar Mar 01 '18 04:03 DamSenViet

There are several hundred "shared extensions to the standard rules" out there, since virtually everyone starts with stylelint-config-standard when writing their own rules.

Ideally your linting configuration should live with the project, since that way everyone working on the project gets the same configuration for style and checking, even if the "other people" working on it are just you in the future.

If placing a configuration file in a parent directory to your projects isn't going to work for you, your only other option is to modify the code of this package, but as I'm a firm believer in having the project configuration stored with the project I'm not going to provide any assistance with that.

Arcanemagus avatar Mar 01 '18 06:03 Arcanemagus