Skip to content

Commit

Permalink
Use eslint-plugin-hexo and jscs-preset-hexo
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Dec 1, 2015
1 parent 59cecc5 commit 79c7ec2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 132 deletions.
45 changes: 2 additions & 43 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,45 +1,4 @@
{
"extends": "eslint:recommended",
"root": true,
"rules": {
"curly": [2, "multi-line"],
"no-console": 0,
"no-path-concat": 2,
"handle-callback-err": 2,
"no-use-before-define": [2, "nofunc"],
"no-shadow-restricted-names": 2,
"block-scoped-var": 2,
"dot-notation": 2,
"eqeqeq": [2, "allow-null"],
"no-else-return": 1,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-implied-eval": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-native-reassign": 2,
"no-new-wrappers": 2,
"no-redeclare": 2,
"no-return-assign": 2,
"no-throw-literal": 2,
"no-unused-expressions": [2, {
"allowShortCircuit": true,
"allowTernary": true
}],
"no-useless-call": 2,
"no-useless-concat": 2,
"no-with": 2,
"radix": 2,
"no-self-compare": 2,
"no-unused-vars": [2, {
"vars": "all",
"args": "none"
}],
"strict": [2, "global"]
},
"env": {
"node": true
}
"extends": "hexo",
"root": true
}
83 changes: 1 addition & 82 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -1,85 +1,4 @@
{
"excludeFiles": ["node_modules/**", "coverage/**", "tmp/**"],
"validateIndentation": 2,
"validateLineBreaks": "LF",
"validateQuoteMarks": "'",
"requireSemicolons": true,
"disallowEmptyBlocks": true,
"disallowKeywordsOnNewLine": ["else"],
"disallowKeywords": ["with"],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineBreaks": true,
"disallowMultipleLineStrings": true,
"disallowMultipleVarDecl": "exceptUndefined",
"disallowNewlineBeforeBlockStatements": true,
"disallowOperatorBeforeLineBreak": ["."],
"disallowSpaceBeforeBinaryOperators": [","],
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforeComma": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpaceBeforeSemicolon": true,
"disallowSpacesInCallExpression": true,
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideParentheses": true,
"disallowSpacesInsideParenthesizedExpression": {
"allExcept": [ "{", "}" ]
},
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
"disallowYodaConditions": true,
"requireBlocksOnNewline": true,
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": [
"for",
"while",
"do",
"try",
"catch"
],
"requireDotNotation": true,
"requireLineBreakAfterVariableAssignment": true,
"requireLineFeedAtFileEnd": true,
"requirePaddingNewLinesAfterBlocks": true,
"requirePaddingNewLinesAfterUseStrict": true,
"requireParenthesesAroundIIFE": true,
"requireSpaceAfterBinaryOperators": true,
"requireSpaceAfterKeywords": [
"do",
"for",
"if",
"else",
"switch",
"case",
"try",
"catch",
"void",
"while",
"with",
"return",
"typeof"
],
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceBeforeBlockStatements": true,
"requireSpaceBetweenArguments": true,
"requireSpacesInFunction": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInConditionalExpression": true,
"requireSpacesInForStatement": true,
"requireSpacesInFunctionDeclaration": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"validateNewlineAfterArrayElements": true,
"validateParameterSeparator": ", ",
"disallowMultipleSpaces": true
"preset": "hexo"
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@
"devDependencies": {
"chai": "^3.4.0",
"eslint": "^1.8.0",
"eslint-config-hexo": "^1.0.2",
"hexo-renderer-marked": "^0.2.5",
"istanbul": "^0.4.0",
"jscs": "^2.5.0",
"jscs-preset-hexo": "^1.0.1",
"mocha": "^2.3.3",
"sinon": "^1.17.2"
},
Expand Down
8 changes: 1 addition & 7 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"extend": "../.eslintrc",
"rules": {
"no-unused-expressions": 0
},
"env": {
"mocha": true
}
"extends": "hexo/test"
}

0 comments on commit 79c7ec2

Please sign in to comment.