Skip to content

Commit be5b661

Browse files
committed
Add linting
1 parent b8ddd28 commit be5b661

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

.eslintrc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"parser": "babel-eslint",
3+
"env": {
4+
"browser": true,
5+
"node": true
6+
},
7+
"plugins": [
8+
"import",
9+
"react"
10+
],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:import/errors",
14+
"plugin:react/recommended"
15+
],
16+
"rules": {
17+
"prefer-arrow-callback": 2,
18+
"semi": [ 2, "never" ]
19+
},
20+
"globals": {
21+
"__DEV__": true
22+
}
23+
}

modules/Broadcast.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class Broadcast extends React.Component {
4141

4242
static propTypes = {
4343
channel: PropTypes.string.isRequired,
44+
children: PropTypes.node.isRequired,
4445
value: PropTypes.any
4546
}
4647

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"build-cjs": "babel ./modules -d . --ignore '__tests__'",
1010
"build-umd": "webpack modules/index.js umd/react-broadcast.js",
1111
"build-min": "webpack -p modules/index.js umd/react-broadcast.min.js",
12-
"prepublish": "node ./scripts/build.js"
12+
"prepublish": "node ./scripts/build.js",
13+
"test": "npm run lint",
14+
"lint": "eslint modules"
1315
},
1416
"dependencies": {
1517
"invariant": "^2.2.1"
@@ -20,12 +22,16 @@
2022
"devDependencies": {
2123
"babel-cli": "^6.16.0",
2224
"babel-core": "^6.16.0",
25+
"babel-eslint": "^7.0.0",
2326
"babel-loader": "^6.2.5",
2427
"babel-plugin-dev-expression": "^0.2.1",
2528
"babel-preset-es2015": "^6.16.0",
2629
"babel-preset-es2015-loose": "^8.0.0",
2730
"babel-preset-react": "^6.16.0",
2831
"babel-preset-stage-1": "^6.16.0",
32+
"eslint": "^3.7.0",
33+
"eslint-plugin-import": "^2.0.0",
34+
"eslint-plugin-react": "^6.3.0",
2935
"gzip-size": "^3.0.0",
3036
"in-publish": "^2.0.0",
3137
"pretty-bytes": "^4.0.2",

0 commit comments

Comments
 (0)