※ 본문은 2016-08-12 기준으로 stylelint-config-standard 12.0.0 기준으로 업데이트 되었습니다.

stylelint-config-standardstylelint에서 사용할 수 있는 문법 규칙 preset입니다. 사실 아직 달리 쓸 것이 없기도 하고, 이미 널리 쓰이는 컨벤션의 합집합 같은 느낌이라서 무난하게 적용 가능합니다. 아직 블로그에서 stylelint를 소개하지 못하고 이것부터 소개하는 것이 아쉽지만 사정상1 이 글 부터 작성합니다.

아래 문서는 예전엔 매우 길었습니다. 하지만 다 읽는 것도, 필요할때 찾아서 읽기에도 매우 불편했습니다. 따라서 표준 설정값과 원본 설명을 바로 볼 수 있는 링크를 바로 배치하는 것으로 기존 내용을 모두 갈음합니다.

at-rule-empty-line-before

설정값

[ "always", {
  except: [
    "blockless-after-same-name-blockless",
    "first-nested",
  ],
  ignore: ["after-comment"],
} ]

at-rule-name-case

설정값

"lower"

at-rule-name-space-after

설정값

"always-single-line"

at-rule-semicolon-newline-after

설정값

"always"

block-closing-brace-empty-line-before

설정값

"never"

block-closing-brace-newline-after

설정값

"always"

block-closing-brace-newline-before

설정값

"always-multi-line"

block-closing-brace-space-before

설정값

"always-single-line"

block-no-empty

설정값

true

block-opening-brace-newline-after

설정값

"always-multi-line"

block-opening-brace-space-after

설정값

"always-single-line"

block-opening-brace-space-before

설정값

"always"

color-hex-case

설정값

"lower"

color-hex-length

설정값

"short"

color-no-invalid-hex

설정값

true

comment-empty-line-before

설정값

[ "always", {
  except: ["first-nested"],
  ignore: ["stylelint-commands"],
} ]

comment-no-empty

설정값

true

comment-whitespace-inside

설정값

"always"

custom-property-empty-line-before

설정값

[ "always", {
  except: [
    "after-custom-property",
    "first-nested",
  ],
  ignore: [
    "after-comment",
    "inside-single-line-block",
  ],
} ]

declaration-bang-space-after

설정값

"never"

declaration-bang-space-before

설정값

"always"

declaration-block-no-ignored-properties

설정값

true

declaration-block-no-shorthand-property-overrides

설정값

true

declaration-block-semicolon-newline-after

설정값

"always-multi-line"

declaration-block-semicolon-space-after

설정값

"always-single-line"

declaration-block-semicolon-space-before

설정값

"never"

declaration-block-single-line-max-declarations

설정값

1

declaration-block-trailing-semicolon

설정값

"always"

declaration-colon-newline-after

설정값

"always-multi-line"

declaration-colon-space-after

설정값

"always-single-line"

declaration-colon-space-before

설정값

"never"

declaration-empty-line-before

설정값

[ "always", {
  except: [
    "after-declaration",
    "first-nested",
  ],
  ignore: [
    "after-comment",
    "inside-single-line-block",
  ],
} ]

function-calc-no-unspaced-operator

설정값

true

function-comma-newline-after

설정값

"always-multi-line"

function-comma-space-after

설정값

"always-single-line"

function-comma-space-before

설정값

"never"

function-linear-gradient-no-nonstandard-direction

설정값

true

function-max-empty-lines

설정값

0

function-name-case

설정값

"lower"

function-parentheses-newline-inside

설정값

"always-multi-line"

function-parentheses-space-inside

설정값

"never-single-line"

function-whitespace-after

설정값

"always"

indentation

설정값

2

keyframe-declaration-no-important

설정값

true

length-zero-no-unit

설정값

true

max-empty-lines

설정값

1

media-feature-colon-space-after

설정값

"always"

media-feature-colon-space-before

설정값

"never"

media-feature-name-case

설정값

"lower"

media-feature-no-missing-punctuation

설정값

true

media-feature-parentheses-space-inside

설정값

"never"

media-feature-range-operator-space-after

설정값

"always"

media-feature-range-operator-space-before

설정값

"always"

media-query-list-comma-newline-after

설정값

"always-multi-line"

media-query-list-comma-space-after

설정값

"always-single-line"

media-query-list-comma-space-before

설정값

"never"

no-empty-source

설정값

true

no-eol-whitespace

설정값

true

no-extra-semicolons

설정값

true

no-invalid-double-slash-comments

설정값

true

no-missing-end-of-source-newline

설정값

true

number-leading-zero

설정값

"always"

number-no-trailing-zeros

설정값

true

property-case

설정값

"lower"

rule-nested-empty-line-before

설정값

[ "always-multi-line", {
  except: ["first-nested"],
  ignore: ["after-comment"],
} ]

rule-non-nested-empty-line-before

설정값

[ "always-multi-line", {
  ignore: ["after-comment"],
} ]

selector-attribute-brackets-space-inside

설정값

"never"

selector-attribute-operator-space-after

설정값

"never"

selector-attribute-operator-space-before

설정값

"never"

selector-combinator-space-after

설정값

"always"

selector-combinator-space-before

설정값

"always"

selector-list-comma-newline-after

설정값

"always"

selector-list-comma-space-before

설정값

"never"

selector-max-empty-lines

설정값

0

selector-pseudo-class-case

설정값

"lower"

selector-pseudo-class-no-unknown

설정값

true

selector-pseudo-class-parentheses-space-inside

설정값

"never"

selector-pseudo-element-case

설정값

"lower"

selector-pseudo-element-colon-notation

설정값

"double"

selector-pseudo-element-no-unknown

설정값

true

selector-type-case

설정값

"lower"

selector-type-no-unknown

설정값

true

shorthand-property-no-redundant-values

설정값

true

string-no-newline

설정값

true

unit-case

설정값

"lower"

unit-no-unknown

설정값

true

value-list-comma-newline-after

설정값

"always-multi-line"

value-list-comma-space-after

설정값

"always-single-line"

value-list-comma-space-before

설정값

"never"

  1. Snoin 팀내 표준으로 적용 여부 검토를 위한 문서화