36.0.0 • Published 3 months ago

stylelint-config-standard v36.0.0

Weekly downloads
1,213,051
License
MIT
Repository
github
Last release
3 months ago

stylelint-config-standard

NPM version Build Status

The standard shareable config for Stylelint.

It extends stylelint-config-recommended and turns on additional rules to enforce modern conventions found in the CSS specifications.

To see the rules that this config uses, please read the config itself.

Example

@import url("foo.css");
@import url("bar.css");

@custom-media --foo (min-width: 30em);

/**
 * Multi-line comment
 */

:root {
  --brand-red: hsl(5deg 10% 40%);
}

/* Single-line comment */

.class-foo:not(a, div) {
  margin: 0;
  top: calc(100% - 2rem);
}

/* Flush single line comment */
@media (width >= 60em) {
  #id-bar {
    /* Flush to parent comment */
    --offset: 0px;

    color: #fff;
    font-family: Helvetica, "Arial Black", sans-serif;
    left: calc(var(--offset) + 50%);
  }

  /* Flush nested single line comment */
  a::after {
    display: block;
    content: "→";
    background-image: url("x.svg");
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

Note: the config is tested against this example, as such the example contains plenty of CSS syntax and features.

Installation

npm install stylelint-config-standard --save-dev

Usage

Set your Stylelint config to:

{
  "extends": "stylelint-config-standard"
}

Extending the config

Add a "rules" key to your config, then add your overrides and additions there.

You can turn off rules by setting its value to null. For example:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "selector-class-pattern": null
  }
}

Or lower the severity of a rule to a warning using the severity secondary option. For example:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "property-no-vendor-prefix": [
      true,
      {
        "severity": "warning"
      }
    ]
  }
}

Or to add a rule, For example, the unit-allowed-list one:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "unit-allowed-list": ["em", "rem", "s"]
  }
}

We recommend adding more of Stylelint's rules to your config as these rules need to be configured to suit your specific needs.

Changelog

License

@yattho/stylelint-configxcc-standard-stylelint@procore/core-scripts@eui/deps-base@vividcat/broom@violetx/stylelint-config@hovey/stylelint-config-basic@critto/styles@xverse/matrix-code-generator@novicell/styles-breadcrumbstylelint-config-dxynora-setupnoodles-normtrs-vue-clireact-antd-scripts-neweslint-config-imagemstylelint-config-wp@kolesa-group/stylelint-configgatsby-starter-emulsify-drupal@quantumblack/carbon-charts@quantumblack/react-starterkolesa-group-stylelint-configkg-stylelint-configstylelint-config-bigpopakap@rock-kit/ui-stylelint-configplum-fabric@dcrtantuco/stylelint-configstylelint-config-fernandopasik@8pt/stylelint-config-basestylelint-config-enfemulsify-design-systemconnexstyleguide@e_ops/mizart-kvlnk-configs@defencedigital/r2d2-lint-configalfred-componentsstylelint-config-nonsensicalstylelint-nonsensical-config@qinshixixing/stylelint-configeslint-config-demingdemingleo-cssstyleyaytradeyaytrade-components@dlwlrma/ngx-linter-formatter@kzx/stylelint-config@alotool/bloggerpackorder-tracking-appgrch-scripts8haodi-font-end-check-configfont-end-check-config-8haodideming-linterawm-lint-utils@conten2/stylelint-config@ebullience/stylelint-config@sno2wman/stylelint-config@ucraft/tools@selfagencyllc/sass-startereslint-config1@dianmi-fe/lint@fundamend/builder-archetype-staticupd4ting-stylelint-configurationeslint-config-airspacevigoworks.componentsstylelint-config-metamolb-config-reactlb-config-vuestylelint-config-airkro@nexhome/restrictionstim-react-scriptsstylelint-config-growcss@temporg/ui-stylelint-config@temporg/config-stylelint@weblab.technology/codestyle@weblab.technology/eslint-config-codestyleeslint-plugin-shoplazza@therms/webapp-wallboard@alotool/alotool-clicustom-react-scripts-graphql@rocklab/stylelint-config-rocklab@bingumd/stylelint-confighzero-front-runtimehzero-react-scriptshzero-webpack-scriptschoerodon-hap-front-bootfragrans-clifrag-cli@pqt/stylelint-config@electron.land/electron-scripts@electronic-minds/stylelint-config-adventure@ebullience/code-config@smb-fe/stylelint-config-standardstylelint-config-jzegstylelint-config-runroomstylelint-config-sevenvalstylelint-config-yandex-orderke-tools-lint@zelz/crank@kununu/react-universal-scripts@zrf9018/marvel-cli
36.0.0

3 months ago

35.0.0

4 months ago

34.0.0

9 months ago

32.0.0

12 months ago

31.0.0

1 year ago

30.0.1

1 year ago

30.0.0

1 year ago

33.0.0

12 months ago

29.0.0

1 year ago

28.0.0

2 years ago

26.0.0

2 years ago

27.0.0

2 years ago

25.0.0

2 years ago

24.0.0

2 years ago

23.0.0-0

2 years ago

23.0.0

2 years ago

22.0.0

3 years ago

21.0.0

3 years ago

20.0.0

4 years ago

19.0.0

5 years ago

18.3.0

5 years ago

18.2.0

6 years ago

18.1.0

6 years ago

18.0.0

6 years ago

17.0.0

7 years ago

16.0.0

7 years ago

15.0.1

7 years ago

15.0.0

7 years ago

14.0.0

7 years ago

13.0.2

8 years ago

13.0.1

8 years ago

13.0.0

8 years ago

12.0.0

8 years ago

11.0.0

8 years ago

10.0.0

8 years ago

9.0.0

8 years ago

8.0.0

8 years ago

7.0.0

8 years ago

6.0.0

8 years ago

5.0.0

8 years ago

4.0.1

8 years ago

4.0.0

8 years ago

3.0.0

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago