Skip to content

Commit aca52fc

Browse files
andrewblondeGavr
authored andcommitted
Add lints
1 parent e306c37 commit aca52fc

7 files changed

Lines changed: 115 additions & 19 deletions

File tree

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ insert_final_newline = true
1111

1212
[*.md]
1313
trim_trailing_whitespace = false
14+
15+
[package.json]
16+
indent_size = 2

.jscs.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
module.exports = {
2+
excludeFiles: [
3+
'node_modules/**',
4+
'coverage/**'
5+
],
6+
requireSpaceAfterKeywords: ['if', 'else', 'for', 'while', 'do', 'switch', 'return', 'try', 'catch'],
7+
requireSpaceBeforeBlockStatements: true,
8+
requireSpacesInConditionalExpression: true,
9+
requireSpacesInFunction: {
10+
beforeOpeningCurlyBrace: true
11+
},
12+
requireSpacesInAnonymousFunctionExpression: {
13+
beforeOpeningRoundBrace: true
14+
},
15+
disallowSpacesInNamedFunctionExpression: {
16+
beforeOpeningRoundBrace: true
17+
},
18+
requireMultipleVarDecl: true,
19+
requireBlocksOnNewline: 1,
20+
disallowPaddingNewlinesInBlocks: true,
21+
disallowSpacesInsideArrayBrackets: 'nested',
22+
disallowSpacesInsideParentheses: true,
23+
requireSpacesInsideObjectBrackets: 'all',
24+
disallowQuotedKeysInObjects: 'allButReserved',
25+
disallowDanglingUnderscores: true,
26+
disallowSpaceAfterObjectKeys: true,
27+
requireCommaBeforeLineBreak: true,
28+
requireOperatorBeforeLineBreak: true,
29+
disallowSpaceAfterPrefixUnaryOperators: true,
30+
disallowSpaceBeforePostfixUnaryOperators: true,
31+
requireSpaceBeforeBinaryOperators: true,
32+
requireSpaceAfterBinaryOperators: true,
33+
requireCamelCaseOrUpperCaseIdentifiers: true,
34+
disallowKeywords: ['with'],
35+
disallowMultipleLineStrings: true,
36+
disallowMultipleLineBreaks: true,
37+
validateLineBreaks: 'LF',
38+
validateQuoteMarks: {
39+
mark: '\'',
40+
escape: true
41+
},
42+
validateIndentation: 4,
43+
disallowMixedSpacesAndTabs: true,
44+
disallowTrailingWhitespace: true,
45+
disallowKeywordsOnNewLine: ['else', 'catch'],
46+
requireLineFeedAtFileEnd: true,
47+
maximumLineLength: 120,
48+
requireCapitalizedConstructors: true,
49+
safeContextKeyword: ['_this'],
50+
disallowYodaConditions: true,
51+
validateJSDoc: {
52+
checkParamNames: true,
53+
checkRedundantParams: true,
54+
requireParamTypes: true
55+
},
56+
requireSpaceAfterLineComment: true,
57+
disallowNewlineBeforeBlockStatements: true
58+
};

.jshintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
coverage

.jshintrc

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
{
2-
"node": true,
3-
"esnext": true,
42
"bitwise": true,
5-
"camelcase": true,
63
"curly": true,
74
"eqeqeq": true,
5+
"es3": true,
6+
"forin": true,
7+
"freeze": true,
88
"immed": true,
9-
"indent": 4,
109
"latedef": true,
11-
"newcap": true,
1210
"noarg": true,
13-
"quotmark": "single",
14-
"regexp": true,
11+
"noempty": true,
12+
"nonbsp": true,
13+
"nonew": true,
1514
"undef": true,
1615
"unused": true,
17-
"strict": true,
18-
"trailing": true,
19-
"smarttabs": true,
20-
"white": true
16+
17+
"browser": true,
18+
"node": true,
19+
20+
"globals": {
21+
"modules": false
22+
},
23+
24+
"expr": true,
25+
"sub": true
2126
}

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ language: node_js
22

33
node_js:
44
- "0.10"
5-
- "0.8"
65

76
env:
87
global:

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
"type": "git",
2323
"url": "git://github.com/bem/html-differ.git"
2424
},
25-
"scripts": {
26-
"test": "npm run func-test && npm run cover",
27-
"func-test": "mocha test",
28-
"cover": "istanbul cover _mocha -- test"
29-
},
3025
"dependencies": {
3126
"vow": "0.4.3",
3227
"vow-fs": "0.3.1",
@@ -35,12 +30,20 @@
3530
"diff": "1.0.8",
3631
"colors": "0.6.2",
3732
"lodash": "2.4.1",
38-
"istanbul": "0.3.0",
3933
"htmlparser2": "3.7.3"
4034
},
4135
"devDependencies": {
4236
"mocha": "1.18.2",
43-
"must": "0.11.0"
37+
"must": "0.11.0",
38+
"istanbul": "0.3.0",
39+
"jshint": "2.5.3",
40+
"jscs": "1.5.9"
41+
},
42+
"scripts": {
43+
"test": "npm run lint && npm run func-test && npm run cover",
44+
"lint": "jshint . && jscs -c .jscs.js .",
45+
"func-test": "mocha test",
46+
"cover": "istanbul cover _mocha -- test"
4447
},
4548
"engines": {
4649
"node": ">=0.8.0",

test/.jshintrc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"bitwise": true,
3+
"curly": true,
4+
"eqeqeq": true,
5+
"forin": true,
6+
"freeze": true,
7+
"immed": true,
8+
"latedef": true,
9+
"noarg": true,
10+
"noempty": true,
11+
"nonbsp": true,
12+
"nonew": true,
13+
"undef": true,
14+
"unused": true,
15+
16+
"browser": true,
17+
"node": true,
18+
19+
"globals": {
20+
"describe": false,
21+
"it": false
22+
},
23+
24+
"expr": true,
25+
"sub": true
26+
}

0 commit comments

Comments
 (0)