2017-04-06 1 views
0

stylelint - 선택 - BEM 패턴 BEM의 린터은 gruntfile</p> <pre><code>stylelint: { all: ['app/styles/**/*.scss'] }, </code></pre> <p>에서

.stylelintrc
{ 
    "plugins": [ 
     "stylelint-selector-bem-pattern" 
    ], 
    "rules": { 
     "plugin/selector-bem-pattern": { 
     "componentName": "[A-Z]+", 
     "componentSelectors": { 
     "initial": "^\\.{componentName}(?:-[a-z]+)?$", 
     "combined": "^\\.combined-{componentName}-[a-z]+$" 
     }, 
     "utilitySelectors": "^\\.util-[a-z]+$" 
    } 
    } 
} 

/사용자/jitendravyas/응용 프로그램 테스트/스타일/구성 요소/_ 캠페인 - 설정 - 통합을 작동하지 내가 stylelint을 실행할 때 .scss

/* @define campaign-settings */ 

.campaign-settings__integrations { 
    @include flex; 
} 

.campaign-settings__integration { 
    border: 1px solid $color-green; 
    border-radius: 3px; 
    color: $color-green; 
    margin-right: $base-spacing-unit; 
    @include flex; 

    .check { 
    background: $color-green; 
    color: white; 
    @include vertical-center; 
    } 

    > div { 
    padding: $half-spacing-unit; 
    } 
} 

는 오류가 발생하지 않습니다. 스타일 린트는 다른 규칙을 사용하고 있습니다.

답변

2

구성 요소 이름을 잘못 정의했다고 생각합니다. 이와 같이, 파일이 올바르게 건너 뛰고 있습니다.

당신 must use중 하나간결또는자세한 구문 :

/** @define campaign-settings */ 

또는 순간

/* postcss-bem-linter: define campaign-settings */ 

당신이 간결의 잘못된 양식을 사용하는 표시 구문 즉 댓글은 /**이 아닌 /*으로 시작됩니다.

+0

첫 번째 의견에서 파일 이름과 구성 요소 이름이 같아야한다는 것을 의미합니까? –

+0

정의에 유효하지 않은 구성 요소 이름이 생겼습니다./*/** @define campaign-settings */*/*/plugin/selector-bem-pattern'오류 –