Skip to content

Commit 4e84dc8

Browse files
committedFeb 11, 2016
Fix lint and test configuration
1 parent 85fec13 commit 4e84dc8

File tree

9 files changed

+24
-11
lines changed

9 files changed

+24
-11
lines changed
 

‎.eslintignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Common directories where we don't care about linting
2+
build/
3+
examples/bundle.js
24
cordova/*
35
grunt/*
46
hooks/*
@@ -9,4 +11,4 @@ res/*
911
scripts/*
1012
www/*
1113
webpack.config.js
12-
Gruntfile.js
14+
Gruntfile.js

‎.eslintrc

+5-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
"space-after-keywords": [2, "always"],
2727
"space-before-blocks": [2, "always"],
2828
"space-before-function-parentheses": 0,
29-
"space-in-brackets": [2, "never"],
3029
"space-in-parens": [2, "never"],
30+
"object-curly-spacing": [2, "never"],
31+
"computed-property-spacing": [2, "never"],
32+
"array-bracket-spacing": [2, "never"],
3133
"new-cap": [2, {"capIsNew": false, "newIsCap": true}],
3234
"strict": 0,
3335
"no-empty": 0,
@@ -39,7 +41,7 @@
3941
"no-alert": 0,
4042

4143
"react/display-name": 0,
42-
"react/jsx-quotes": [1, "double", "avoid-escape"],
44+
"jsx-quotes": [1, "prefer-double"],
4345
"react/jsx-no-undef": 1,
4446
"react/jsx-uses-react": 1,
4547
"react/jsx-uses-vars": 1,
@@ -55,4 +57,4 @@
5557
"__DEV__": false,
5658
"__VER__": false
5759
}
58-
}
60+
}

‎.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
language: node_js
22
node_js:
33
- "0.12"
4+
script:
5+
- npm run lint
6+
- npm test

‎examples/master/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const Node = React.createClass({
6969
],
7070
size: DEFAULT_NODE_SIZE,
7171
deleted: false
72-
}
72+
};
7373
},
7474

7575
move(x = 0, y = 0) {

‎examples/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ config.plugins.push(
1010
/^react-hotkeys$/,
1111
'../../lib/index'
1212
)
13-
)
13+
);
1414

1515
module.exports = config;

‎lib/FocusTrap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const FocusTrap = React.createClass({
1212
getDefaultProps() {
1313
return {
1414
component: 'div'
15-
}
15+
};
1616
},
1717

1818
render() {

‎lib/HotKeys.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const HotKeys = React.createClass({
164164
<FocusTrap {...this.props} onFocus={this.onFocus} onBlur={this.onBlur}>
165165
{this.props.children}
166166
</FocusTrap>
167-
)
167+
);
168168
}
169169

170170
});

‎package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010
"autoprefixer-loader": "^1.2.0",
1111
"babel": "^5.0.12",
1212
"babel-core": "^4.7.16",
13-
"babel-eslint": "^2.0.2",
13+
"babel-eslint": "^4.1.8",
1414
"babel-loader": "^4.3.0",
1515
"css-loader": "^0.9.1",
16+
"eslint": "^1.10.3",
17+
"eslint-plugin-react": "^3.16.1",
18+
"mocha": "^2.4.5",
1619
"prompt": "^0.2.14",
20+
"react": "^0.14.7",
1721
"react-addons-test-utils": "^0.14.0",
22+
"react-dom": "^0.14.7",
1823
"style-loader": "^0.9.0",
1924
"webpack": "^1.7.3"
2025
},
@@ -27,7 +32,8 @@
2732
"react-dom": "^0.14.0"
2833
},
2934
"scripts": {
30-
"test": "bash ./scripts/test",
35+
"lint": "eslint .",
36+
"test": "mocha --compilers js:babel/register lib/**/__tests__/*.js",
3137
"build-global": "bash ./scripts/build-global",
3238
"build-npm": "bash ./scripts/build-npm"
3339
},

‎scripts/test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash -e
22

3-
mocha --compilers js:babel/register lib/**/__tests__/*.js
3+
npm run test

0 commit comments

Comments
 (0)
Please sign in to comment.