Skip to content

Commit 3555c78

Browse files
authored
Fix linting and enable cache on travis (#229)
* Fix linting and enable cache on travis * Add babel-core for babel-jest
1 parent 118ed58 commit 3555c78

File tree

6 files changed

+78
-69
lines changed

6 files changed

+78
-69
lines changed

.eslintrc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"parser": "babel-eslint",
3+
"extends": "eslint:recommended",
34
"rules": {
4-
"comma-dangle": [1, "always-multiline"],
5+
"comma-dangle": ["error", "always-multiline"],
56
"no-underscore-dangle": 0,
6-
"quotes": [2, "single", "avoid-escape"],
7+
"quotes": ["error", "single", "avoid-escape"],
78
"strict": 0,
8-
"no-unused-vars": 2,
9-
"no-undef": 2
9+
"no-unused-vars": "error",
10+
"no-undef": "error"
1011
},
1112
"env": {
1213
"node": true,

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ node_js:
44
- "4"
55
- "6"
66
- "8"
7-
script: npm run check
7+
before_install:
8+
- curl -o- -L https://yarnpkg.com/install.sh | bash
9+
- export PATH="$HOME/.yarn/bin:$PATH"
10+
cache:
11+
yarn: true
12+
directories:
13+
- ".eslintcache"
14+
- "node_modules"
15+
script: yarn test:ci

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
],
1818
"main": "dist/main.js",
1919
"scripts": {
20-
"check": "npm run lint && npm run flow && npm test",
21-
"flow": "flow",
22-
"lint": "eslint src/",
23-
"watch": "babel src/ --out-dir dist/ --watch",
2420
"build": "rimraf dist/ && babel src/ --out-dir dist/ --ignore __tests__,__mocks__",
25-
"prepublish": "npm run build",
26-
"preversion": "npm run lint",
27-
"test": "jest"
21+
"lint": "eslint src/ bin/",
22+
"prepublish": "yarn run build",
23+
"preversion": "yarn run lint",
24+
"test": "jest",
25+
"test:ci": "yarn lint && yarn flow && yarn test --runInBand",
26+
"watch": "yarn build --watch"
2827
},
2928
"keywords": [
3029
"react",
@@ -42,12 +41,13 @@
4241
"recast": "^0.12.6"
4342
},
4443
"devDependencies": {
45-
"babel-cli": "^6.9.0",
44+
"babel-cli": "^6.26.0",
45+
"babel-core": "^6.26.0",
4646
"babel-eslint": "^7.0.0",
4747
"babel-jest": "^21.2.0",
48-
"babel-plugin-transform-object-rest-spread": "^6.23.0",
49-
"babel-plugin-transform-runtime": "^6.9.0",
50-
"babel-preset-env": "^1.1.8",
48+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
49+
"babel-plugin-transform-runtime": "^6.23.0",
50+
"babel-preset-env": "^1.6.1",
5151
"babel-preset-flow": "^6.23.0",
5252
"cross-spawn": "^5.0.0",
5353
"eslint": "^4.3.0",

0 commit comments

Comments
 (0)