Skip to content

Commit 2810b27

Browse files
authored
chore: adds circleCi config + fix eslint, flow errors.
chore: adds circleCi config + fix eslint, flow errors.
2 parents fef9462 + 797939f commit 2810b27

25 files changed

Lines changed: 5924 additions & 393 deletions

.circleci/config.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: 2
2+
3+
defaults: &defaults
4+
docker:
5+
- image: circleci/node:10
6+
working_directory: ~/react-native-fbads
7+
8+
jobs:
9+
install-dependencies:
10+
<<: *defaults
11+
steps:
12+
- checkout
13+
- attach_workspace:
14+
at: ~/react-native-fbads
15+
- restore_cache:
16+
keys:
17+
- dependencies-{{ checksum "package.json" }}
18+
- dependencies-
19+
- run: |
20+
yarn install --frozen-lockfile
21+
- save_cache:
22+
key: dependencies-{{ checksum "package.json" }}
23+
paths: node_modules
24+
- persist_to_workspace:
25+
root: .
26+
paths: .
27+
lint:
28+
<<: *defaults
29+
steps:
30+
- attach_workspace:
31+
at: ~/react-native-fbads
32+
- run: |
33+
yarn lint
34+
flow:
35+
<<: *defaults
36+
steps:
37+
- attach_workspace:
38+
at: ~/react-native-fbads
39+
- run: |
40+
yarn flow
41+
workflows:
42+
version: 2
43+
build-and-test:
44+
jobs:
45+
- install-dependencies
46+
- lint:
47+
requires:
48+
- install-dependencies

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.eslintrc

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,14 @@
11
{
2-
"parser": "babel-eslint",
3-
"extends": "airbnb",
42
"env": {
5-
"browser": true,
6-
"node": true,
7-
"mocha": true,
8-
"es6": true
3+
"browser": true
94
},
105

11-
"parserOptions": {
12-
"sourceType": "module",
13-
"ecmaFeatures": {
14-
"jsx": true
15-
}
16-
},
6+
"extends": ["@callstack"],
177

18-
"globals": {
19-
"__DEV__": true
20-
},
8+
"plugins": ["react-native"],
219

2210
"rules": {
23-
"strict": 0,
24-
25-
"arrow-body-style": 0,
26-
"arrow-parens": 0,
27-
"default-case": 0,
28-
"generator-star-spacing": 0,
29-
"global-require": 0,
30-
"new-cap": 0,
31-
"no-alert": 0,
32-
"no-confusing-arrow": 0,
33-
"no-console": 0,
34-
"no-constant-condition": 0,
35-
"no-duplicate-imports": 0,
36-
"no-restricted-syntax": 0,
37-
"no-underscore-dangle": 0,
38-
"no-use-before-define": 0,
39-
40-
"import/no-duplicates": 0,
41-
"import/no-unresolved": 0,
42-
43-
"react/jsx-no-bind": 0,
44-
"react/jsx-filename-extension": 0,
45-
"react/forbid-prop-types": 0,
46-
"react/prefer-stateless-function": 0,
47-
"react/sort-comp": 0
11+
"react/no-multi-comp": "off",
12+
"no-console": "off"
4813
}
49-
}
14+
}

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2
5151
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5252

5353
[version]
54-
>=0.80.0
54+
^0.67.1

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"singleQuote": true
2+
"singleQuote": true,
3+
"trailingComma": "es5"
34
}

AdChoicesManager.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @flow
2-
import React, { PropTypes } from 'react';
2+
import React from 'react';
33
import { requireNativeComponent, StyleSheet, Platform } from 'react-native';
44
import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
55

@@ -13,13 +13,13 @@ type AdChoiceLocation = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
1313
type Props = {
1414
location: AdChoiceLocation,
1515
expandable: boolean,
16-
style?: ViewStyleProp
16+
style?: ViewStyleProp,
1717
};
1818

1919
export default class AdChoicesView extends React.Component<Props> {
2020
static defaultProps: Props = {
2121
location: 'topLeft',
22-
expandable: false
22+
expandable: false,
2323
};
2424

2525
render() {
@@ -44,12 +44,12 @@ let styles = StyleSheet.create({
4444
...Platform.select({
4545
ios: {
4646
width: 0,
47-
height: 0
47+
height: 0,
4848
},
4949
android: {
5050
width: 22,
51-
height: 22
52-
}
53-
})
54-
}
51+
height: 22,
52+
},
53+
}),
54+
},
5555
});

AdIconViewManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AdIconViewChild extends React.Component<PropsType> {
2727
}
2828
}
2929

30-
export default class AdIconView extends React.Component<Object> {
30+
export default class AdIconView extends React.Component<{}> {
3131
render() {
3232
return (
3333
<AdIconViewContext.Consumer>

AdSettings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ export default {
5454
*/
5555
setUrlPrefix(urlPrefix: string) {
5656
CTKAdSettingsManager.setUrlPrefix(urlPrefix);
57-
}
57+
},
5858
};

BannerViewManager.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
// @flow
1+
/* @flow */
22
import React from 'react';
33
import { requireNativeComponent } from 'react-native';
4+
import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
45

56
type AdType = 'large' | 'rectangle' | 'standard';
67

78
const CTKBannerView = requireNativeComponent('CTKBannerView', null, {
89
onAdPress: true,
9-
onAdError: true
10+
onAdError: true,
1011
});
1112

1213
const sizeForType = {
1314
large: 90,
1415
rectangle: 250,
15-
standard: 50
16+
standard: 50,
1617
};
1718

1819
/**
@@ -24,9 +25,9 @@ const getSizeForType = (type: AdType) =>
2425
type BannerViewProps = {
2526
type: AdType,
2627
placementId: string,
27-
onPress: Function,
28-
onError: Function,
29-
style: any
28+
onPress: () => mixed,
29+
onError: () => mixed,
30+
style: ViewStyleProp,
3031
};
3132

3233
const BannerView = (props: BannerViewProps) => {

InterstitialAdManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ export default {
99
*/
1010
showAd(placementId: string): Promise<boolean> {
1111
return CTKInterstitialAdManager.showAd(placementId);
12-
}
12+
},
1313
};

0 commit comments

Comments
 (0)