Skip to content

Commit 79c7ec2

Browse files
committed
Use eslint-plugin-hexo and jscs-preset-hexo
1 parent 59cecc5 commit 79c7ec2

File tree

4 files changed

+6
-132
lines changed

4 files changed

+6
-132
lines changed

.eslintrc

+2-43
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,4 @@
11
{
2-
"extends": "eslint:recommended",
3-
"root": true,
4-
"rules": {
5-
"curly": [2, "multi-line"],
6-
"no-console": 0,
7-
"no-path-concat": 2,
8-
"handle-callback-err": 2,
9-
"no-use-before-define": [2, "nofunc"],
10-
"no-shadow-restricted-names": 2,
11-
"block-scoped-var": 2,
12-
"dot-notation": 2,
13-
"eqeqeq": [2, "allow-null"],
14-
"no-else-return": 1,
15-
"no-extend-native": 2,
16-
"no-extra-bind": 2,
17-
"no-implied-eval": 2,
18-
"no-lone-blocks": 2,
19-
"no-loop-func": 2,
20-
"no-multi-spaces": 2,
21-
"no-multi-str": 2,
22-
"no-native-reassign": 2,
23-
"no-new-wrappers": 2,
24-
"no-redeclare": 2,
25-
"no-return-assign": 2,
26-
"no-throw-literal": 2,
27-
"no-unused-expressions": [2, {
28-
"allowShortCircuit": true,
29-
"allowTernary": true
30-
}],
31-
"no-useless-call": 2,
32-
"no-useless-concat": 2,
33-
"no-with": 2,
34-
"radix": 2,
35-
"no-self-compare": 2,
36-
"no-unused-vars": [2, {
37-
"vars": "all",
38-
"args": "none"
39-
}],
40-
"strict": [2, "global"]
41-
},
42-
"env": {
43-
"node": true
44-
}
2+
"extends": "hexo",
3+
"root": true
454
}

.jscsrc

+1-82
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,4 @@
11
{
22
"excludeFiles": ["node_modules/**", "coverage/**", "tmp/**"],
3-
"validateIndentation": 2,
4-
"validateLineBreaks": "LF",
5-
"validateQuoteMarks": "'",
6-
"requireSemicolons": true,
7-
"disallowEmptyBlocks": true,
8-
"disallowKeywordsOnNewLine": ["else"],
9-
"disallowKeywords": ["with"],
10-
"disallowMixedSpacesAndTabs": true,
11-
"disallowMultipleLineBreaks": true,
12-
"disallowMultipleLineStrings": true,
13-
"disallowMultipleVarDecl": "exceptUndefined",
14-
"disallowNewlineBeforeBlockStatements": true,
15-
"disallowOperatorBeforeLineBreak": ["."],
16-
"disallowSpaceBeforeBinaryOperators": [","],
17-
"disallowSpaceAfterObjectKeys": true,
18-
"disallowSpaceAfterPrefixUnaryOperators": true,
19-
"disallowSpaceBeforeComma": true,
20-
"disallowSpaceBeforePostfixUnaryOperators": true,
21-
"disallowSpaceBeforeSemicolon": true,
22-
"disallowSpacesInCallExpression": true,
23-
"disallowSpacesInFunctionDeclaration": {
24-
"beforeOpeningRoundBrace": true
25-
},
26-
"disallowSpacesInFunctionExpression": {
27-
"beforeOpeningRoundBrace": true
28-
},
29-
"disallowSpacesInsideParentheses": true,
30-
"disallowSpacesInsideParenthesizedExpression": {
31-
"allExcept": [ "{", "}" ]
32-
},
33-
"disallowTrailingComma": true,
34-
"disallowTrailingWhitespace": true,
35-
"disallowYodaConditions": true,
36-
"requireBlocksOnNewline": true,
37-
"requireCapitalizedConstructors": true,
38-
"requireCommaBeforeLineBreak": true,
39-
"requireCurlyBraces": [
40-
"for",
41-
"while",
42-
"do",
43-
"try",
44-
"catch"
45-
],
46-
"requireDotNotation": true,
47-
"requireLineBreakAfterVariableAssignment": true,
48-
"requireLineFeedAtFileEnd": true,
49-
"requirePaddingNewLinesAfterBlocks": true,
50-
"requirePaddingNewLinesAfterUseStrict": true,
51-
"requireParenthesesAroundIIFE": true,
52-
"requireSpaceAfterBinaryOperators": true,
53-
"requireSpaceAfterKeywords": [
54-
"do",
55-
"for",
56-
"if",
57-
"else",
58-
"switch",
59-
"case",
60-
"try",
61-
"catch",
62-
"void",
63-
"while",
64-
"with",
65-
"return",
66-
"typeof"
67-
],
68-
"requireSpaceBeforeBinaryOperators": true,
69-
"requireSpaceBeforeBlockStatements": true,
70-
"requireSpaceBetweenArguments": true,
71-
"requireSpacesInFunction": {
72-
"beforeOpeningCurlyBrace": true
73-
},
74-
"requireSpacesInConditionalExpression": true,
75-
"requireSpacesInForStatement": true,
76-
"requireSpacesInFunctionDeclaration": {
77-
"beforeOpeningCurlyBrace": true
78-
},
79-
"requireSpacesInFunctionExpression": {
80-
"beforeOpeningCurlyBrace": true
81-
},
82-
"validateNewlineAfterArrayElements": true,
83-
"validateParameterSeparator": ", ",
84-
"disallowMultipleSpaces": true
3+
"preset": "hexo"
854
}

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@
5757
"devDependencies": {
5858
"chai": "^3.4.0",
5959
"eslint": "^1.8.0",
60+
"eslint-config-hexo": "^1.0.2",
6061
"hexo-renderer-marked": "^0.2.5",
6162
"istanbul": "^0.4.0",
6263
"jscs": "^2.5.0",
64+
"jscs-preset-hexo": "^1.0.1",
6365
"mocha": "^2.3.3",
6466
"sinon": "^1.17.2"
6567
},

test/.eslintrc

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
{
2-
"extend": "../.eslintrc",
3-
"rules": {
4-
"no-unused-expressions": 0
5-
},
6-
"env": {
7-
"mocha": true
8-
}
2+
"extends": "hexo/test"
93
}

0 commit comments

Comments
 (0)