Skip to content

Commit 437bc64

Browse files
committed
Adds prettier.
Removes flow. Goes hipster.
1 parent ef14091 commit 437bc64

File tree

17 files changed

+1362
-1185
lines changed

17 files changed

+1362
-1185
lines changed

.babelrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
["env", { "targets": { "node": true } }],
44
"stage-3"
55
],
6-
"plugins": [
7-
"syntax-flow",
8-
"transform-flow-strip-types"
9-
],
106
"env": {
117
"commonjs": {
128
"presets": [

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
flow-typed/
2-
tools/flow/
31
node_modules/
42
commonjs/
53
coverage/

.eslintrc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"root": true,
33
"parser": "babel-eslint",
44
"extends": "airbnb-base",
5-
"plugins": [
6-
"flowtype"
7-
],
5+
"plugins": [],
86
"env": {
97
"browser": true,
108
"es6": true,
@@ -14,5 +12,19 @@
1412
"ecmaFeatures": {
1513
"defaultParams": true
1614
},
17-
"rules": {}
15+
"rules": {
16+
"no-confusing-arrow": 0,
17+
18+
"max-len": [
19+
"error",
20+
{
21+
"ignoreComments": false,
22+
"ignoreStrings": true,
23+
"code": 80
24+
}
25+
],
26+
27+
// Going hipster
28+
"semi": [2, "never"]
29+
}
1830
}

.flowconfig

Lines changed: 0 additions & 43 deletions
This file was deleted.

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.9.4
1+
6.9.5

package.json

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,64 +22,61 @@
2222
"scripts": {
2323
"build": "babel-node ./tools/scripts/build.js",
2424
"check": "yarn run lint && yarn run test",
25-
"clean": "rimraf ./commonjs && rimraf ./umd && rimraf ./coverage && rimraf ./flow-coverage && rimraf ./umd",
25+
"clean": "rimraf ./commonjs && rimraf ./umd && rimraf ./coverage && rimraf ./umd",
2626
"example:web": "echo 'Make sure to `cd example/web && yarn install`' && cd example/web && yarn run start",
27-
"flow": "babel-node ./tools/scripts/flow",
28-
"flow:coverage": "flow-coverage-report -i 'src/**/*.js' -t html -t json -t text",
29-
"flow:defs": "flow-typed install --overwrite",
3027
"lint": "eslint src",
28+
"precommit": "lint-staged && npm run test",
3129
"prepublish": "yarn run build",
3230
"test": "jest",
3331
"test:coverage": "yarn run test -- --coverage",
3432
"test:coverage:deploy": "yarn run test:coverage && codecov"
3533
},
34+
"jest": {
35+
"collectCoverageFrom": [
36+
"src/**/*.{js,jsx}"
37+
],
38+
"testPathIgnorePatterns": [
39+
"<rootDir>/(commonjs|coverage|flow-typed|node_modules|tools|umd)/"
40+
]
41+
},
42+
"lint-staged": {
43+
"*.js": [
44+
"prettier-eslint --write",
45+
"git add"
46+
]
47+
},
3648
"devDependencies": {
3749
"app-root-dir": "1.0.2",
38-
"babel-cli": "6.18.0",
39-
"babel-core": "6.21.0",
50+
"babel-cli": "6.24.0",
51+
"babel-core": "6.24.0",
4052
"babel-eslint": "7.1.1",
41-
"babel-jest": "18.0.0",
42-
"babel-loader": "6.2.10",
43-
"babel-plugin-syntax-flow": "6.18.0",
44-
"babel-plugin-transform-flow-strip-types": "6.21.0",
45-
"babel-polyfill": "6.20.0",
46-
"babel-preset-env": "1.1.8",
47-
"babel-preset-latest": "6.16.0",
48-
"babel-preset-stage-3": "6.17.0",
49-
"babel-register": "6.18.0",
53+
"babel-jest": "19.0.0",
54+
"babel-loader": "6.4.0",
55+
"babel-polyfill": "6.23.0",
56+
"babel-preset-env": "1.2.1",
57+
"babel-preset-latest": "6.24.0",
58+
"babel-preset-stage-3": "6.22.0",
59+
"babel-register": "6.24.0",
5060
"codecov": "1.0.1",
51-
"cross-env": "3.1.4",
52-
"eslint": "3.13.1",
53-
"eslint-config-airbnb": "14.0.0",
54-
"eslint-plugin-flowtype": "2.30.0",
61+
"cross-env": "3.2.3",
62+
"eslint": "3.17.1",
63+
"eslint-config-airbnb": "14.1.0",
5564
"eslint-plugin-import": "2.2.0",
56-
"eslint-plugin-jsx-a11y": "3.0.2",
57-
"flow-bin": "0.37.4",
58-
"flow-coverage-report": "0.2.0",
59-
"flow-typed": "2.0.0",
60-
"ghooks": "2.0.0",
65+
"eslint-plugin-jsx-a11y": "4.0.0",
6166
"gzip-size": "3.0.0",
67+
"husky": "0.13.2",
6268
"in-publish": "2.0.0",
63-
"jest": "18.1.0",
69+
"jest": "19.0.2",
70+
"lint-staged": "3.4.0",
71+
"prettier": "0.22.0",
72+
"prettier-eslint": "4.2.1",
73+
"prettier-eslint-cli": "3.1.2",
6474
"pretty-bytes": "4.0.2",
6575
"ramda": "0.23.0",
66-
"readline-sync": "1.4.5",
67-
"rimraf": "2.5.4",
68-
"webpack": "2.2.0-rc.3",
69-
"webpack-dev-middleware": "1.9.0",
70-
"webpack-hot-middleware": "2.15.0"
71-
},
72-
"config": {
73-
"ghooks": {
74-
"pre-commit": "yarn run check"
75-
}
76-
},
77-
"jest": {
78-
"collectCoverageFrom": [
79-
"src/**/*.{js,jsx}"
80-
],
81-
"testPathIgnorePatterns": [
82-
"<rootDir>/(commonjs|coverage|flow-typed|node_modules|tools|umd)/"
83-
]
76+
"readline-sync": "1.4.6",
77+
"rimraf": "2.6.1",
78+
"webpack": "2.2.1",
79+
"webpack-dev-middleware": "1.10.1",
80+
"webpack-hot-middleware": "2.17.1"
8481
}
8582
}

src/__tests__/helloWorld.test.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
/* @flow */
2-
3-
import helloWorld from '../helloWorld';
1+
import helloWorld from '../helloWorld'
42

53
describe('helloWorld', () => {
64
it('returns the expected result', () => {
7-
const expected = 'hello world';
8-
const actual = helloWorld();
9-
expect(expected).toEqual(actual);
10-
});
11-
});
5+
const expected = 'hello world'
6+
const actual = helloWorld()
7+
expect(expected).toEqual(actual)
8+
})
9+
})

src/goodbyeWorld.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/* @flow */
2-
31
function goodbyeWorld() {
4-
return 'goodbye world';
2+
return 'goodbye world'
53
}
64

7-
export default goodbyeWorld;
5+
export default goodbyeWorld

src/helloWorld.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/* @flow */
2-
31
function helloWorld() {
4-
return 'hello world';
2+
return 'hello world'
53
}
64

7-
export default helloWorld;
5+
export default helloWorld

src/index.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
/* @flow */
1+
import helloWorld from './helloWorld'
2+
import goodbyeWorld from './goodbyeWorld'
23

3-
import helloWorld from './helloWorld';
4-
import goodbyeWorld from './goodbyeWorld';
5-
6-
export {
7-
helloWorld,
8-
goodbyeWorld,
9-
};
4+
export { helloWorld, goodbyeWorld }

0 commit comments

Comments
 (0)