Permalink
Browse files

indentation can extend editorconfig

  • Loading branch information...
1 parent c54592f commit f5e897a17335b4f5a9f0adeac60dc5a64a895a67 刘祺 committed Oct 11, 2016
Showing with 10 additions and 6 deletions.
  1. +1 −1 .eslintrc.json
  2. +8 −4 lib/params.js
  3. +1 −1 test/stylelint/extends/extend-stylelint.js
View
@@ -8,7 +8,7 @@
"no-console": 0,
"space-before-function-paren": [2, "always"],
"semi": [2, "never"],
- "eqeqeq": [2, "always"],
+ "eqeqeq": [2, "allow-null"],
"block-spacing": [2, "always"]
}
}
View
@@ -15,15 +15,19 @@ function hasScssInDir (wd) {
function getEditorConfig (file, rules) {
rules = rules || {}
- if(!file || rules && ["indentation", "no-missing-end-of-source-newline", "no-eol-whitespace"].every(function (key) {
- return key in rules
+ if(!file || ["indentation", "no-missing-end-of-source-newline", "no-eol-whitespace"].every(function (key) {
+ return getProperty(rules, key)
})) {
return rules
}
function setRules (key, value) {
- if(!(key in rules) && value !== null) {
- rules[key] = value
+ if(value != null && !getProperty(rules, key)) {
+ if(Array.isArray(rules[key])) {
+ rules[key][0] = value
+ } else {
+ rules[key] = value
+ }
}
}
@@ -43,7 +43,7 @@ module.exports = {
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never-single-line",
"function-whitespace-after": "always",
- "indentation": 2,
+ "indentation": 0,
"max-empty-lines": 1,
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",

0 comments on commit f5e897a

Please sign in to comment.