Skip to content

Commit bfd4da6

Browse files
danezfkling
authored andcommitted
Add eslint to dev dependencies
Also fix some linting issues
1 parent 0cf842b commit bfd4da6

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ language: node_js
33
node_js:
44
- 4
55
- 5
6+
- stable
7+
script:
8+
- npm run lint
9+
- npm run test

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
},
1313
"main": "dist/main.js",
1414
"scripts": {
15+
"lint": "eslint src/",
1516
"watch": "babel src/ --out-dir dist/ --watch",
1617
"build": "rm -rf dist/ && babel src/ --out-dir dist/ --ignore __tests__,__mocks__",
1718
"prepublish": "npm run build",
19+
"preversion": "npm run lint",
1820
"test": "jest"
1921
},
2022
"keywords": [
@@ -34,11 +36,13 @@
3436
},
3537
"devDependencies": {
3638
"babel": "^5.6.23",
39+
"babel-eslint": "^6.0.4",
3740
"babel-jest": "^5.3.0",
41+
"cross-spawn-async": "^2.1.9",
42+
"eslint": "^2.10.2",
3843
"jest-cli": "^0.8.0",
3944
"rimraf": "^2.3.2",
40-
"temp": "^0.8.1",
41-
"cross-spawn-async": "^2.1.9"
45+
"temp": "^0.8.1"
4246
},
4347
"jest": {
4448
"preprocessCachingDisabled": true,

src/handlers/__tests__/flowTypeDocBlockHandler-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,19 @@ describe('flowTypeDocBlockHandler', () => {
9696
describe('TypeAlias', () => {
9797
describe('class definition', () => {
9898
test(
99-
propTypesSrc => statement(template(`class Foo extends Component<void, Props, void> {}`, propTypesSrc))
99+
propTypesSrc => statement(template('class Foo extends Component<void, Props, void> {}', propTypesSrc))
100100
);
101101
});
102102

103103
describe('class definition with inline props', () => {
104104
test(
105-
propTypesSrc => statement(template(`class Foo extends Component { props: Props; }`, propTypesSrc))
105+
propTypesSrc => statement(template('class Foo extends Component { props: Props; }', propTypesSrc))
106106
);
107107
});
108108

109109
describe('stateless component', () => {
110110
test(
111-
propTypesSrc => statement(template(`(props: Props) => <div />;`, propTypesSrc)).get('expression')
111+
propTypesSrc => statement(template('(props: Props) => <div />;', propTypesSrc)).get('expression')
112112
);
113113
});
114114
});

src/handlers/__tests__/flowTypeHandler-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,19 @@ describe('flowTypeHandler', () => {
136136
describe('TypeAlias', () => {
137137
describe('class definition', () => {
138138
test(
139-
propTypesSrc => statement(template(`class Foo extends Component<void, Props, void> {}`, propTypesSrc))
139+
propTypesSrc => statement(template('class Foo extends Component<void, Props, void> {}', propTypesSrc))
140140
);
141141
});
142142

143143
describe('class definition with inline props', () => {
144144
test(
145-
propTypesSrc => statement(template(`class Foo extends Component { props: Props; }`, propTypesSrc))
145+
propTypesSrc => statement(template('class Foo extends Component { props: Props; }', propTypesSrc))
146146
);
147147
});
148148

149149
describe('stateless component', () => {
150150
test(
151-
propTypesSrc => statement(template(`(props: Props) => <div />;`, propTypesSrc)).get('expression')
151+
propTypesSrc => statement(template('(props: Props) => <div />;', propTypesSrc)).get('expression')
152152
);
153153
});
154154
});

0 commit comments

Comments
 (0)