Skip to content

Commit 85b6d2b

Browse files
committed
Scaffolding
1 parent c6cc0f1 commit 85b6d2b

File tree

9 files changed

+4423
-1
lines changed

9 files changed

+4423
-1
lines changed

.babelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": [["env", {"modules": false}], "flow", "react"],
3+
"env": {
4+
"test": {
5+
"presets": ["env", "flow", "react"]
6+
}
7+
}
8+
}

.eslintrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "airbnb",
3+
"parser": "babel-eslint",
4+
"plugins": [
5+
"flowtype"
6+
]
7+
}

.flowconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[ignore]
2+
3+
[include]
4+
5+
[libs]
6+
7+
[lints]
8+
9+
[options]
10+
11+
[strict]
12+
nonstrict-import
13+
sketchy-null
14+
unclear-type
15+
unsafe-getters-setters
16+
untyped-import
17+
untyped-type-import

package.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "redux-json-api-scope",
33
"version": "0.1.0",
44
"description": "Easy data handling for redux-json-api",
5+
"browser": "lib/index.js",
56
"main": "lib/index.js",
67
"author": "Ronni Egeriis Persson <[email protected]>",
78
"license": "MIT",
@@ -12,5 +13,31 @@
1213
"bugs": {
1314
"url": "https://github.com/redux-json-api/redux-json-api-scope/issues"
1415
},
15-
"homepage": "https://github.com/redux-json-api/redux-json-api-scope#readme"
16+
"homepage": "https://github.com/redux-json-api/redux-json-api-scope#readme",
17+
"scripts": {
18+
"build": "yarn run ci && rimraf lib/* && rollup -c",
19+
"ci": "yarn run test && yarn run lint",
20+
"lint": "eslint . ./",
21+
"test": "jest"
22+
},
23+
"devDependencies": {
24+
"babel-cli": "^6.26.0",
25+
"babel-core": "^6.26.3",
26+
"babel-eslint": "7",
27+
"babel-jest": "^22.4.3",
28+
"babel-preset-env": "^1.7.0",
29+
"babel-preset-flow": "^6.23.0",
30+
"babel-preset-react": "^6.24.1",
31+
"eslint": "^4.19.1",
32+
"eslint-config-airbnb": "^16.1.0",
33+
"eslint-plugin-flowtype": "^2.46.3",
34+
"eslint-plugin-import": "^2.11.0",
35+
"eslint-plugin-jsx-a11y": "^6.0.3",
36+
"eslint-plugin-react": "^7.8.2",
37+
"flow-bin": "^0.72.0",
38+
"jest": "^22.4.3",
39+
"regenerator-runtime": "^0.11.1",
40+
"rimraf": "^2.6.2",
41+
"rollup": "^0.56.4"
42+
}
1643
}

rollup.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import pkg from './package.json';
2+
3+
export default {
4+
input: 'src/index.js',
5+
external: Object.keys(pkg.dependencies),
6+
output: [
7+
{ file: pkg.browser, format: 'es' },
8+
],
9+
};

src/__tests__/something.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* @flow strict */
2+
import something from '../something';
3+
4+
it('does not return anything', () => {
5+
expect(something(1)).toBe();
6+
});

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* @flow strict */
2+
import something from './something';
3+
4+
console.log(something('hello'));

src/something.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* @flow strict */
2+
3+
export default function something(arg1: number): void {
4+
if (arg1 === 'hello') {
5+
return;
6+
}
7+
8+
return;
9+
};

0 commit comments

Comments
 (0)