Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Instructions slightly unclear #390

Open
DamSenViet opened this issue Feb 24, 2018 · 7 comments
Open

Instructions slightly unclear #390

DamSenViet opened this issue Feb 24, 2018 · 7 comments

Comments

@DamSenViet
Copy link

DamSenViet commented Feb 24, 2018

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.

@ChristinWhite
Copy link

ChristinWhite commented Feb 28, 2018

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!

@Arcanemagus
Copy link
Member

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

@ChristinWhite
Copy link

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.

@Arcanemagus
Copy link
Member

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.

@ChristinWhite
Copy link

Thanks!

@DamSenViet
Copy link
Author

DamSenViet commented Mar 1, 2018

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.

@Arcanemagus
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants