Skip to content

Commit eccfd1e

Browse files
committed
install bambi for typecheking
1 parent 03d521b commit eccfd1e

File tree

6 files changed

+439
-710
lines changed

6 files changed

+439
-710
lines changed

.eslintignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
11
**/node_modules
2-
**/android
3-
**/ios
4-
**/vendors
5-
**/coverage
6-
**/flow-coverage

.eslintrc

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,7 @@
11
{
2-
"extends": [
3-
"react-app",
4-
"prettier",
5-
"prettier/flowtype",
6-
"prettier/react"
7-
],
8-
"plugins": [
9-
"flowtype",
10-
"react",
11-
"prettier"
12-
],
13-
"globals": {
14-
"__DEV__": true
15-
},
2+
"extends": ["bambi/native"],
163
"rules": {
17-
"no-use-before-define": 0,
18-
"no-unused-vars": "error",
19-
"prettier/prettier": [
20-
"error",
21-
{
22-
"trailingComma": "es5",
23-
"singleQuote": true,
24-
"printWidth": 100
25-
}
26-
]
4+
"prettier/prettier": "error",
5+
"flowtype/type-id-match": [0, ""],
276
}
287
}

package.json

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"description": "ScrollView with an image in header which become a navbar",
55
"main": "src/index.js",
66
"scripts": {
7-
"lint": "eslint src/*.js",
7+
"lint": "eslint .",
88
"test": "npm run lint && flow",
9-
"prettify": "prettier --single-quote --trailing-comma es5 --print-width 100 --write src/**.js"
9+
"prettify": "prettier --write src/**.js"
1010
},
1111
"files": ["README.md", "LICENCE", "src", "readmeAssets"],
1212
"repository": {
@@ -29,16 +29,9 @@
2929
},
3030
"homepage": "https://github.com/bamlab/react-native-image-header-scroll-view#readme",
3131
"devDependencies": {
32-
"babel-eslint": "^7.2.3",
33-
"babel-preset-react-native": "1.9.1",
34-
"eslint": "^3.19.0",
35-
"eslint-config-prettier": "1.7.0",
36-
"eslint-config-react-app": "^0.6.2",
37-
"eslint-plugin-flowtype": "^2.32.1",
38-
"eslint-plugin-import": "^2.2.0",
39-
"eslint-plugin-jsx-a11y": "^4.0.0",
40-
"eslint-plugin-prettier": "2.1.2",
41-
"eslint-plugin-react": "^6.10.0",
32+
"babel-preset-react-native": "4.0.0",
33+
"eslint": "^4.14.0",
34+
"eslint-config-bambi": "^1.2.0",
4235
"flow-bin": "^0.61.0",
4336
"prettier": "^1.10.2",
4437
"react": "16.2.0",
@@ -50,5 +43,8 @@
5043
},
5144
"dependencies": {
5245
"prop-types": "^15.6.0"
46+
},
47+
"eslintConfig": {
48+
"extends": "bambi/native"
5349
}
5450
}

src/ImageHeaderScrollView.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export type State = {
3838
};
3939

4040
class ImageHeaderScrollView extends Component<Props, State> {
41-
container: ?any; // @see https://github.com/facebook/react-native/issues/15955
42-
scrollViewRef: ?any; // @see https://github.com/facebook/react-native/issues/15955
41+
container: ?View; // @see https://github.com/facebook/react-native/issues/15955
42+
scrollViewRef: ?ScrollView; // @see https://github.com/facebook/react-native/issues/15955
4343
state: State;
4444

4545
static defaultProps: DefaultProps = {
@@ -201,6 +201,7 @@ class ImageHeaderScrollView extends Component<Props, State> {
201201
};
202202

203203
render() {
204+
/* eslint-disable no-unused-vars */
204205
const {
205206
children,
206207
childrenStyle,
@@ -217,6 +218,7 @@ class ImageHeaderScrollView extends Component<Props, State> {
217218
renderTouchableFixedForeground,
218219
...scrollViewProps
219220
} = this.props;
221+
/* eslint-enable no-unused-vars */
220222

221223
const headerScrollDistance = this.interpolateOnImageHeight([maxHeight, maxHeight - minHeight]);
222224
const topMargin = this.interpolateOnImageHeight([0, minHeight]);

src/TriggeringView.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class TriggeringView extends Component<Props, State> {
126126
}
127127

128128
render() {
129+
/* eslint-disable no-unused-vars */
129130
const {
130131
onBeginHidden,
131132
onHide,
@@ -135,6 +136,8 @@ class TriggeringView extends Component<Props, State> {
135136
onTouchBottom,
136137
...viewProps
137138
} = this.props;
139+
/* eslint-enable no-unused-vars */
140+
138141
return (
139142
<View ref={this.onRef} collapsable={false} {...viewProps} onLayout={this.onLayout}>
140143
{this.props.children}

0 commit comments

Comments
 (0)