Skip to content

Commit 6f19678

Browse files
committed
fix: lint and ts errors
1 parent 863d86f commit 6f19678

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

example/src/screens/BenchmarkScreen.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable react-native/no-inline-styles */
12
import React, {useCallback, useMemo, useState} from 'react';
23
import Chance from 'chance';
34
import {

example/src/screens/UnitTestScreen.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const UnitTestScreen: React.FC = () => {
2020
<ScrollView
2121
contentContainerStyle={[
2222
ScreenStyles.container,
23+
// eslint-disable-next-line react-native/no-inline-styles
2324
{alignItems: 'flex-start'},
2425
]}>
2526
{results.map((r, i) => {

example/src/tests/MochaRNAdapter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ export const describe = (name: string, f: () => void): void => {
4242
mochaContext = prevMochaContext;
4343
};
4444

45-
export const beforeEach = (f: () => void): void => {
45+
export const beforeEach = (f: Mocha.Func) => mochaContext.beforeEach(f);
46+
export const beforeEachAsync = (f: Mocha.AsyncFunc) =>
4647
mochaContext.beforeEach(f);
47-
};
4848

49-
export const beforeAll = (f: MochaTypes.Func) => {
49+
export const beforeAll = (f: MochaTypes.Func) => mochaContext.beforeAll(f);
50+
export const beforeAllAsync = (f: MochaTypes.AsyncFunc) =>
5051
mochaContext.beforeAll(f);
51-
};

example/src/tests/typeorm.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type {Repository} from 'typeorm';
22
import {DataSource} from 'typeorm';
3-
import {beforeAll, beforeEach, it, describe} from './MochaRNAdapter';
3+
import {beforeAll, it, describe, beforeEachAsync} from './MochaRNAdapter';
44
import {typeORMDriver} from 'react-native-nitro-sqlite';
55
import {User} from '../model/User';
66
import {Book} from '../model/Book';
@@ -14,7 +14,7 @@ let bookRepository: Repository<Book>;
1414

1515
export function registerTypeORMTests() {
1616
describe('Typeorm tests', () => {
17-
beforeAll((done: any) => {
17+
beforeAll(done => {
1818
dataSource = new DataSource({
1919
type: 'react-native',
2020
database: 'typeormDb.sqlite',
@@ -37,12 +37,12 @@ export function registerTypeORMTests() {
3737
});
3838
});
3939

40-
beforeEach(async () => {
40+
beforeEachAsync(async () => {
4141
await userRepository.clear();
4242
await bookRepository.clear();
4343
});
4444

45-
it('basic test', async () => {
45+
it('basic test', () => {
4646
expect(1).to.equal(2);
4747
});
4848
});

package/src/operations/transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface PendingTransaction {
2020
start: () => void
2121
}
2222

23-
export const transaction = async (
23+
export const transaction = (
2424
dbName: string,
2525
fn: (tx: Transaction) => Promise<void> | void
2626
): Promise<void> => {

0 commit comments

Comments
 (0)