Skip to content

Commit

Permalink
chore: update dependencies, de-lint java / ts
Browse files Browse the repository at this point in the history
also switched 'yarn run' to 'yarn', yarn does not need run now
  • Loading branch information
mikehardy committed Dec 24, 2020
1 parent 4a57578 commit 1beb5b5
Show file tree
Hide file tree
Showing 129 changed files with 490 additions and 1,441 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ module.exports = {
'no-underscore-dangle': 'off',
'no-use-before-define': 0,
'import/no-unresolved': 0,
'@typescript-eslint/ban-ts-comment': 'off', // keep it professional when you use them though please
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-empty-function': 'off',
// off for validation tests
Expand All @@ -45,7 +47,6 @@ module.exports = {
'mocha/no-top-level-hooks': 'off', // potentially has value if anyone wants to refactor
'mocha/no-hooks-for-single-case': 'off', // potentially has value
'mocha/no-setup-in-describe': 'off', // potentially has value, large refactor here though

},
globals: {
__DEV__: true,
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
max_attempts: 3
command: yarn --no-audit --prefer-offline
- name: Lint
run: yarn run lint
run: yarn lint
- name: Save Code Linting Report JSON
run: yarn run lint:report
run: yarn lint:report
continue-on-error: true
- name: Annotate Code Linting Results
uses: ataylorme/[email protected]
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
max_attempts: 3
command: yarn --no-audit --prefer-offline
- name: Lint
run: yarn run tsc:compile
run: yarn tsc:compile

typedoc:
name: TypeDoc Generation
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- name: Pre-fetch Javascript bundle
# Prebuild the bundle so that's fast when the app starts.
run: |
nohup yarn run tests:packager:jet &
nohup yarn tests:packager:jet &
printf 'Waiting for packager to come online'
until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do
printf '.'
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:

- name: Pre-fetch Javascript bundle
run: |
nohup yarn run tests:packager:jet &
nohup yarn tests:packager:jet &
printf 'Waiting for packager to come online'
until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do
printf '.'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
max_attempts: 3
command: yarn --no-audit --prefer-offline
- name: Jest
run: yarn run tests:jest-coverage
run: yarn tests:jest-coverage
- name: Submit Coverage
# This can fail on timeouts etc, wrap with retry
uses: nick-invision/retry@v2
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,30 @@
"format:markdown": "prettier --write \"docs/**/*.md\""
},
"devDependencies": {
"@babel/preset-env": "7.9.5",
"@babel/preset-flow": "7.9.0",
"@types/jest": "^25.2.1",
"@babel/preset-env": "7.12.11",
"@babel/preset-flow": "7.12.1",
"@types/jest": "^26.0.19",
"@types/react": "^16.9.49",
"@types/react-native": "^0.62.0",
"@typescript-eslint/eslint-plugin": "^2.18.0",
"@typescript-eslint/parser": "^2.18.0",
"@types/react-native": "^0.63.42",
"@typescript-eslint/eslint-plugin": "^4.11.0",
"@typescript-eslint/parser": "^4.11.0",
"codecov": "^3.6.5",
"conventional-changelog-cli": "^2.0.34",
"cross-env": "^7.0.2",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.5.0",
"cross-env": "^7.0.3",
"eslint": "^7.16.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-prettier": "^3.3.0",
"eslint-plugin-react": "^7.19.0",
"genversion": "^2.2.0",
"inquirer": "^7.1.0",
"jest": "^25.5.1",
"lerna": "3.20.2",
"prettier": "^1.19.1",
"jest": "^26.6.3",
"lerna": "3.22.1",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"shelljs": "^0.8.3",
"ts-jest": "^25.4.0",
"typescript": "^3.8.3"
"ts-jest": "^26.4.4",
"typescript": "^4.1.3"
},
"resolutions": {
"@types/react": "^16.9.49"
Expand Down
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Empty file modified packages/admob/e2e/admob.e2e.js
Whitespace-only changes.
Empty file modified packages/admob/e2e/consent.e2e.js
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Empty file modified packages/admob/e2e/rewarded.e2e.js
Whitespace-only changes.
Whitespace-only changes.
13 changes: 7 additions & 6 deletions packages/admob/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ export namespace FirebaseAdMobTypes {
*
* @param listener A listener callback containing a event type, error and data.
*/
onAdEvent(listener: AdEventListener): Function;
onAdEvent(listener: AdEventListener): () => void;

/**
* Show the loaded advert to the user.
Expand Down Expand Up @@ -1134,27 +1134,27 @@ export namespace FirebaseAdMobTypes {
/**
* When an ad has finished loading.
*/
onAdLoaded: Function;
onAdLoaded: () => void;

/**
* When an ad has failed to load. Callback contains an Error.
*/
onAdFailedToLoad: Function;
onAdFailedToLoad: (error: Error) => void;

/**
* The ad is now visible to the user.
*/
onAdOpened: Function;
onAdOpened: () => void;

/**
* Called when the user is about to return to the app after tapping on an ad.
*/
onAdClosed: Function;
onAdClosed: () => void;

/**
* Called when the user has left the application (e.g. clicking an advert).
*/
onAdLeftApplication: Function;
onAdLeftApplication: () => void;
}

/**
Expand Down Expand Up @@ -1219,6 +1219,7 @@ export default defaultExport;
* Attach namespace to `firebase.` and `FirebaseApp.`.
*/
declare module '@react-native-firebase/app' {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
namespace ReactNativeFirebase {
import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp;

Expand Down
Whitespace-only changes.
Whitespace-only changes.
1 change: 1 addition & 0 deletions packages/analytics/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,7 @@ export default defaultExport;
* Attach namespace to `firebase.` and `FirebaseApp.`.
*/
declare module '@react-native-firebase/app' {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
namespace ReactNativeFirebase {
import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
interface Module {
Expand Down
Whitespace-only changes.
Empty file modified packages/app/e2e/app.e2e.js
Whitespace-only changes.
Empty file modified packages/app/e2e/config.e2e.js
Whitespace-only changes.
Empty file modified packages/app/e2e/events.e2e.js
Whitespace-only changes.
Empty file modified packages/app/e2e/utils.e2e.js
Whitespace-only changes.
Empty file modified packages/app/e2e/utilsStatics.e2e.js
Whitespace-only changes.
2 changes: 2 additions & 0 deletions packages/app/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export namespace ReactNativeFirebase {
private emitter: any;
}

// eslint-disable-next-line @typescript-eslint/ban-types
export type FirebaseModuleWithStatics<M, S = {}> = {
(): M;

Expand All @@ -229,6 +230,7 @@ export namespace ReactNativeFirebase {
readonly SDK_VERSION: string;
} & S;

// eslint-disable-next-line @typescript-eslint/ban-types
export type FirebaseModuleWithStaticsAndApp<M, S = {}> = {
(app?: FirebaseApp): M;

Expand Down
Empty file modified packages/auth/__tests__/auth.test.ts
Whitespace-only changes.
54 changes: 10 additions & 44 deletions packages/auth/e2e/auth.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ describe('auth()', function() {
.auth(firebase.app('secondaryFromNative'))
.app.name.should.equal('secondaryFromNative');

firebase
.app('secondaryFromNative')
.auth()
.app.name.should.equal('secondaryFromNative');
firebase.app('secondaryFromNative').auth().app.name.should.equal('secondaryFromNative');
});
});

Expand Down Expand Up @@ -523,10 +520,7 @@ describe('auth()', function() {
return firebase.auth().signOut();
};

return firebase
.auth()
.signInAnonymously()
.then(successCb);
return firebase.auth().signInAnonymously().then(successCb);
});
});

Expand All @@ -549,10 +543,7 @@ describe('auth()', function() {
return firebase.auth().signOut();
};

return firebase
.auth()
.signInWithEmailAndPassword(TEST_EMAIL, TEST_PASS)
.then(successCb);
return firebase.auth().signInWithEmailAndPassword(TEST_EMAIL, TEST_PASS).then(successCb);
});

it('it should error on login if user is disabled', function () {
Expand Down Expand Up @@ -633,10 +624,7 @@ describe('auth()', function() {
return firebase.auth().signOut();
};

return firebase
.auth()
.signInWithCredential(credential)
.then(successCb);
return firebase.auth().signInWithCredential(credential).then(successCb);
});

it('it should error on login if user is disabled', function () {
Expand All @@ -650,11 +638,7 @@ describe('auth()', function() {
return Promise.resolve();
};

return firebase
.auth()
.signInWithCredential(credential)
.then(successCb)
.catch(failureCb);
return firebase.auth().signInWithCredential(credential).then(successCb).catch(failureCb);
});

it('it should error on login if password incorrect', function () {
Expand All @@ -670,11 +654,7 @@ describe('auth()', function() {
return Promise.resolve();
};

return firebase
.auth()
.signInWithCredential(credential)
.then(successCb)
.catch(failureCb);
return firebase.auth().signInWithCredential(credential).then(successCb).catch(failureCb);
});

it('it should error on login if user not found', function () {
Expand All @@ -694,11 +674,7 @@ describe('auth()', function() {
return Promise.resolve();
};

return firebase
.auth()
.signInWithCredential(credential)
.then(successCb)
.catch(failureCb);
return firebase.auth().signInWithCredential(credential).then(successCb).catch(failureCb);
});
});

Expand All @@ -723,10 +699,7 @@ describe('auth()', function() {
return newUser.delete();
};

return firebase
.auth()
.createUserWithEmailAndPassword(email, pass)
.then(successCb);
return firebase.auth().createUserWithEmailAndPassword(email, pass).then(successCb);
});

it('it should error on create with invalid email', function () {
Expand Down Expand Up @@ -867,11 +840,7 @@ describe('auth()', function() {
resolve();
};

return firebase
.auth()
.signOut()
.then(successCb)
.catch(failureCb);
return firebase.auth().signOut().then(successCb).catch(failureCb);
});
});
});
Expand All @@ -892,10 +861,7 @@ describe('auth()', function() {
return firebase.auth().currentUser.delete();
};

return firebase
.auth()
.createUserWithEmailAndPassword(email, pass)
.then(successCb);
return firebase.auth().createUserWithEmailAndPassword(email, pass).then(successCb);
});
});

Expand Down
Empty file modified packages/auth/e2e/emailLink.e2e.js
Whitespace-only changes.
Empty file modified packages/auth/e2e/phone.e2e.js
Whitespace-only changes.
Empty file modified packages/auth/e2e/provider.e2e.js
Whitespace-only changes.
Empty file modified packages/auth/e2e/rnReload.e2e.js
Whitespace-only changes.
Empty file modified packages/auth/e2e/user.e2e.js
Whitespace-only changes.
2 changes: 2 additions & 0 deletions packages/auth/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,7 @@ export namespace FirebaseAuthTypes {
* const user = firebase.auth().currentUser.toJSON();
* ```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
toJSON(): object;

/**
Expand Down Expand Up @@ -1669,6 +1670,7 @@ export default defaultExport;
* Attach namespace to `firebase.` and `FirebaseApp.`.
*/
declare module '@react-native-firebase/app' {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
namespace ReactNativeFirebase {
import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp;
interface Module {
Expand Down
Whitespace-only changes.
Whitespace-only changes.
1 change: 1 addition & 0 deletions packages/crashlytics/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export default defaultExport;
* Attach namespace to `firebase.` and `FirebaseApp.`.
*/
declare module '@react-native-firebase/app' {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
namespace ReactNativeFirebase {
import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
interface Module {
Expand Down
Whitespace-only changes.
10 changes: 2 additions & 8 deletions packages/database/e2e/database.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ describe('database()', function() {
.database(firebase.app('secondaryFromNative'))
.app.name.should.eql('secondaryFromNative');

firebase
.app('secondaryFromNative')
.database()
.app.name.should.eql('secondaryFromNative');
firebase.app('secondaryFromNative').database().app.name.should.eql('secondaryFromNative');
});
});

Expand All @@ -44,10 +41,7 @@ describe('database()', function() {
.database(firebase.app('secondaryFromNative'))
.app.name.should.eql('secondaryFromNative');

firebase
.app('secondaryFromNative')
.database()
.app.name.should.eql('secondaryFromNative');
firebase.app('secondaryFromNative').database().app.name.should.eql('secondaryFromNative');
});

describe('ref()', function () {
Expand Down
15 changes: 3 additions & 12 deletions packages/database/e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,13 @@ const CONTENT = {

exports.seed = function seed(path) {
return Promise.all([
firebase
.database()
.ref(`${path}/types`)
.set(CONTENT.TYPES),
firebase
.database()
.ref(`${path}/query`)
.set(CONTENT.QUERY),
firebase.database().ref(`${path}/types`).set(CONTENT.TYPES),
firebase.database().ref(`${path}/query`).set(CONTENT.QUERY),
]);
};

exports.wipe = function wipe(path) {
return firebase
.database()
.ref(path)
.remove();
return firebase.database().ref(path).remove();
};

exports.PATH = PATH;
Expand Down
Loading

0 comments on commit 1beb5b5

Please sign in to comment.