2017-09-16 40 views
-1

내 Mac (OS X 10.12.6 - Sierra)에 stylelint (npm install -g 스타일리스트)를 다운로드하고 본질적으로 복사 한 후 은 here이라는 샘플 구성 파일을 수정하려고 시도했습니다. 내가 무엇을 할 생각이 없다stylelint : 오류 : 정의되지 않은 규칙 null

Error: Undefined rule null 
at module.exports (/usr/local/lib/node_modules/stylelint/lib/utils/configurationError.js:8:28) 
at Object.keys.forEach.ruleName (/usr/local/lib/node_modules/stylelint/lib/augmentConfig.js:302:13) 
at Array.forEach (<anonymous>) 
at normalizeAllRuleSettings (/usr/local/lib/node_modules/stylelint/lib/augmentConfig.js:297:29) 
at augmentConfigBasic.then.then.then.augmentedConfig (/usr/local/lib/node_modules/stylelint/lib/augmentConfig.js:91:14) 
at <anonymous> 

:

나는 그때 오류와 끝까지 내 ~/.stylelintrc 파일에 오타를 수정 한 후, 내가 가진 CSS 파일에서 실행하려고 노력하고 이걸 지나서 - 내가 할 코드 디버깅을 시도하고 싶습니다 (내 자신의 코드를 디버깅하는 데 충분한 문제가 있습니다.이 도구가 도움이되기를 바랬습니다. 다른 사람의 코드를 디버깅하려고 시도 할 대역폭이 없습니다.)

도움 말 하시겠습니까?


업데이트 : 요청에 따라 - 내 ~/.stylelintrc 파일 :

{ 
    "rules": { 
    "at-rule-empty-line-before": "always", 
    "at-rule-name-case": "lower", 
    "at-rule-name-newline-after": "always-multi-line", 
    "at-rule-name-space-after": "always-single-line", 
    "at-rule-no-unknown": true, 
    "at-rule-no-vendor-prefix": true, 
    "at-rule-semicolon-newline-after": "always", 
    "at-rule-semicolon-space-before": "never", 
    "block-closing-brace-empty-line-before": "always-multi-line", 
    "block-closing-brace-newline-after": "always", 
    "block-closing-brace-newline-before": "always", 
    "block-closing-brace-space-after": ["never-single-line", "never-multi-line"], 
    "block-closing-brace-space-before": "never", 
    "block-no-empty": true, 
    "block-opening-brace-newline-after": "always", 
    "block-opening-brace-newline-before": ["never-single-line", "never-multi-line"], 
    "block-opening-brace-space-after": ["never-single-line", "never-multi-line"], 
    "block-opening-brace-space-before": "always", 
    "color-hex-case": "upper", 
    "color-hex-length": "long", 
    "color-named": "always-where-possible", 
    "color-no-hex": true, 
    "color-no-invalid-hex": true, 
    "comment-empty-line-before": "always", 
    "comment-no-empty": true, 
    "comment-whitespace-inside": "always", 
    "custom-property-empty-line-before": "always", 
    "declaration-bang-space-after": "always", 
    "declaration-bang-space-before": "always", 
    "declaration-block-no-duplicate-properties": true, 
    "declaration-block-no-redundant-longhand-properties": true, 
    "declaration-block-no-shorthand-property-overrides": true, 
    "declaration-block-semicolon-newline-after": "always", 
    "declaration-block-semicolon-newline-before": "always", 
    "declaration-block-semicolon-space-after": "always", 
    "declaration-block-semicolon-space-before": "never", 
    "declaration-block-single-line-max-declarations": 2, 
    "declaration-block-trailing-semicolon": "always", 
    "declaration-colon-newline-after": "always", 
    "declaration-colon-space-after": "always", 
    "declaration-colon-space-before": "never", 
    "declaration-empty-line-before": "always", 
    "declaration-no-important": true, 
    "declaration-property-unit-blacklist": {}, 
    "declaration-property-unit-whitelist": {}, 
    "declaration-property-value-blacklist": {}, 
    "declaration-property-value-whitelist": {}, 
    "font-family-name-quotes": "always-where-required", 
    "font-family-no-duplicate-names": true, 
    "font-weight-notation": "numeric", 
    "function-calc-no-unspaced-operator": true, 
    "function-comma-newline-after": "always", 
    "function-comma-newline-before": "always", 
    "function-comma-space-after": "always", 
    "function-comma-space-before": "never", 
    "function-linear-gradient-no-nonstandard-direction": true, 
    "function-max-empty-lines": 1, 
    "function-name-case": "lower", 
    "function-parentheses-newline-inside": "always", 
    "function-parentheses-space-inside": "never", 
    "function-url-no-scheme-relative": true, 
    "function-url-quotes": "always", 
    "function-whitespace-after": "always", 
    "indentation": 4, 
    "keyframe-declaration-no-important": true, 
    "length-zero-no-unit": true, 
    "max-empty-lines": 1, 
    "max-line-length": 80,, 
    "max-nesting-depth": 3, 
    "media-feature-colon-space-after": "always", 
    "media-feature-colon-space-before": "never", 
    "media-feature-name-case": "lower", 
    "media-feature-name-no-unknown": true, 
    "media-feature-name-no-vendor-prefix": true, 
    "media-feature-parentheses-space-inside": "never", 
    "media-feature-range-operator-space-after": "always", 
    "media-feature-range-operator-space-before": "never", 
    "media-query-list-comma-newline-after": "never-multi-line", 
    "media-query-list-comma-newline-before": "never-multi-line", 
    "media-query-list-comma-space-after": "always", 
    "media-query-list-comma-space-before": "never", 
    "no-descending-specificity": true, 
    "no-duplicate-selectors": true, 
    "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, 
    "no-unknown-animations": true, 
    "number-leading-zero": "never", 
    "number-max-precision": 3, 
    "number-no-trailing-zeros": true, 
    "property-case": "lower", 
    "property-no-unknown": true, 
    "property-no-vendor-prefix": true, 
    "rule-empty-line-before": "always", 
    "selector-attribute-brackets-space-inside": "never", 
    "selector-attribute-operator-space-after": "always", 
    "selector-attribute-operator-space-before": "never", 
    "selector-attribute-quotes": "always", 
    "selector-combinator-space-after": "always", 
    "selector-combinator-space-before": "never", 
    "selector-descendant-combinator-no-non-space": true, 
    "selector-list-comma-newline-after": "never-multi-line", 
    "selector-list-comma-newline-before": "never-multi-line", 
    "selector-list-comma-space-after": "always", 
    "selector-list-comma-space-before": "never", 
    "selector-max-attribute": 5, 
    "selector-max-class": 5, 
    "selector-max-combinators": 5, 
    "selector-max-compound-selectors": 5, 
    "selector-max-empty-lines": 1, 
    "selector-max-id": 5, 
    "selector-max-type": 5, 
    "selector-max-universal": 5, 
    "selector-no-qualifying-type": true, 
    "selector-no-vendor-prefix": true, 
    "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": "single", 
    "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, 
    "string-quotes": "double", 
    "time-min-milliseconds": 5, 
    "unit-case": "lower", 
    "unit-no-unknown": true, 
    "value-keyword-case": "lower", 
    "value-list-comma-newline-after": "never-multi-line", 
    "value-list-comma-newline-before": "never-multi-line", 
    "value-list-comma-space-after": "always", 
    "value-list-comma-space-before": "never", 
    "value-list-max-empty-lines": 1, 
    "value-no-vendor-prefix": true 
    } 
} 
+0

'.stylelintrc' 파일의 내용을 게시하거나 https://gist.github.com/ntwb에 게시하여 여기에 연결하면 도움이 될 것입니다. – netweb

답변

1

"max-line-length": 80,, 줄 뒤에 쉼표가 나타납니다. 잘못된 JSON입니다.

JSONLint 같은 도구를 사용하거나 JSON 구문 검사 기능이있는 코드 편집기를 사용하면 이러한 문제를 발견하는 데 도움이됩니다.

+0

늦게 입력하는 약간의 뚱뚱한 손가락 밤에 이런 일이 생깁니다 - 나는 단지 더 명확한 오류 메시지를 얻을 수 있었으면 좋겠어 ... 고마워. –