Skip to content

Commit 16c2758

Browse files
committed
chore: run prettier
1 parent 21fdf45 commit 16c2758

22 files changed

+125
-120
lines changed

.watchmanconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

example/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ module.exports = {
55
project: true,
66
tsconfigRootDir: __dirname,
77
},
8-
};
8+
}

example/.watchmanconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

example/babel.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const path = require('path');
2-
const pak = require('../package/package.json');
1+
const path = require('path')
2+
const pak = require('../package/package.json')
33

44
module.exports = {
55
presets: ['module:@react-native/babel-preset'],
@@ -10,12 +10,12 @@ module.exports = {
1010
extensions: ['.tsx', '.ts', '.js', '.json'],
1111
alias: {
1212
[pak.name]: path.join(__dirname, '../package', pak.source),
13-
stream: 'stream-browserify',
13+
'stream': 'stream-browserify',
1414
'react-native-sqlite-storage': 'react-native-nitro-sqlite',
1515
},
1616
},
1717
],
1818
'babel-plugin-transform-typescript-metadata',
19-
['@babel/plugin-proposal-decorators', {legacy: true}],
19+
['@babel/plugin-proposal-decorators', { legacy: true }],
2020
],
21-
};
21+
}

example/metro.config.js

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
const fs = require('fs');
2-
const path = require('path');
3-
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
4-
const exclusionList = require('metro-config/src/defaults/exclusionList');
5-
const escape = require('escape-string-regexp');
1+
const fs = require('fs')
2+
const path = require('path')
3+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config')
4+
const exclusionList = require('metro-config/src/defaults/exclusionList')
5+
const escape = require('escape-string-regexp')
66

7-
const root = path.resolve(__dirname, '..');
8-
const rootNodeModulesPath = path.join(root, 'node_modules');
9-
const exampleNodeModulesPath = path.join(__dirname, 'node_modules');
7+
const root = path.resolve(__dirname, '..')
8+
const rootNodeModulesPath = path.join(root, 'node_modules')
9+
const exampleNodeModulesPath = path.join(__dirname, 'node_modules')
1010

1111
function getPackageNames(nodeModulesPath) {
1212
if (!fs.existsSync(nodeModulesPath)) {
13-
return [];
13+
return []
1414
}
1515

16-
const allFiles = fs.readdirSync(nodeModulesPath);
16+
const allFiles = fs.readdirSync(nodeModulesPath)
1717

1818
// Filter out only directories (package names)
19-
const packageNames = allFiles.filter(file => {
20-
const filePath = path.join(nodeModulesPath, file);
21-
return fs.statSync(filePath).isDirectory();
22-
});
19+
const packageNames = allFiles.filter((file) => {
20+
const filePath = path.join(nodeModulesPath, file)
21+
return fs.statSync(filePath).isDirectory()
22+
})
2323

2424
// Handle scoped packages (e.g., @scope/package)
2525
const scopedPackages = packageNames
26-
.filter(pkg => pkg.startsWith('@'))
27-
.flatMap(scope => {
28-
const scopePath = path.join(nodeModulesPath, scope);
29-
const scopedFiles = fs.readdirSync(scopePath);
30-
return scopedFiles.map(scopedFile => `${scope}/${scopedFile}`);
31-
});
26+
.filter((pkg) => pkg.startsWith('@'))
27+
.flatMap((scope) => {
28+
const scopePath = path.join(nodeModulesPath, scope)
29+
const scopedFiles = fs.readdirSync(scopePath)
30+
return scopedFiles.map((scopedFile) => `${scope}/${scopedFile}`)
31+
})
3232

3333
// Return both regular and scoped package names
3434
return packageNames
35-
.filter(pkg => !pkg.startsWith('@'))
36-
.concat(scopedPackages);
35+
.filter((pkg) => !pkg.startsWith('@'))
36+
.concat(scopedPackages)
3737
}
3838

39-
const exampleNodeModules = getPackageNames(exampleNodeModulesPath);
39+
const exampleNodeModules = getPackageNames(exampleNodeModulesPath)
4040

4141
const config = {
4242
projectRoot: __dirname,
@@ -48,7 +48,8 @@ const config = {
4848
unstable_enableSymlinks: true,
4949
blockList: exclusionList(
5050
exampleNodeModules.map(
51-
m => new RegExp(`^${escape(path.join(rootNodeModulesPath, m))}\\/.*$`),
51+
(m) =>
52+
new RegExp(`^${escape(path.join(rootNodeModulesPath, m))}\\/.*$`),
5253
),
5354
),
5455

@@ -70,6 +71,6 @@ const config = {
7071
},
7172
}),
7273
},
73-
};
74+
}
7475

75-
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
76+
module.exports = mergeConfig(getDefaultConfig(__dirname), config)

example/react-native.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const path = require('path');
2-
const pak = require('../package/package.json');
1+
const path = require('path')
2+
const pak = require('../package/package.json')
33

44
module.exports = {
55
dependencies: {
66
[pak.name]: {
77
root: path.join(__dirname, '../package'),
88
},
99
},
10-
};
10+
}

example/src/App.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,18 @@ export default function App() {
1111
return (
1212
<NavigationContainer>
1313
<RootStack.Navigator initialRouteName="NitroSQLite Example">
14-
<RootStack.Screen name="NitroSQLite Example" component={HomeScreen} />
15-
<RootStack.Screen name="Unit Tests" component={UnitTestScreen} />
16-
<RootStack.Screen name="Benchmarks" component={BenchmarkScreen} />
14+
<RootStack.Screen
15+
name="NitroSQLite Example"
16+
component={HomeScreen}
17+
/>
18+
<RootStack.Screen
19+
name="Unit Tests"
20+
component={UnitTestScreen}
21+
/>
22+
<RootStack.Screen
23+
name="Benchmarks"
24+
component={BenchmarkScreen}
25+
/>
1726
</RootStack.Navigator>
1827

1928
<StatusBar style="auto" />

example/src/screens/BenchmarkScreen.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ const benchmarks: Benchmark[] = [
3636
resetTestDb()
3737
testDb?.execute('DROP TABLE IF EXISTS User;')
3838
testDb?.execute(
39-
'CREATE TABLE User ( id REAL PRIMARY KEY, name TEXT NOT NULL, age REAL, networth REAL) STRICT;'
39+
'CREATE TABLE User ( id REAL PRIMARY KEY, name TEXT NOT NULL, age REAL, networth REAL) STRICT;',
4040
)
4141
},
4242
run: (i) => {
4343
testDb?.execute(
4444
'INSERT INTO User (id, name, age, networth) VALUES(?, ?, ?, ?)',
45-
[ids[i], stringValue, integerValue, doubleValue]
45+
[ids[i], stringValue, integerValue, doubleValue],
4646
)
4747
},
4848
},
@@ -126,7 +126,10 @@ export function BenchmarkScreen() {
126126
benchmarks.map(({ description }, index) => {
127127
const time = results[description]
128128
return (
129-
<View style={{ paddingBottom: 10 }} key={index}>
129+
<View
130+
style={{ paddingBottom: 10 }}
131+
key={index}
132+
>
130133
<View
131134
style={{
132135
flexDirection: 'row',
@@ -159,7 +162,7 @@ export function BenchmarkScreen() {
159162
</View>
160163
)
161164
}),
162-
[results]
165+
[results],
163166
)
164167

165168
return (

example/src/screens/UnitTestScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function UnitTestScreen() {
1111
useEffect(() => {
1212
setResults([])
1313
runTests(
14-
registerUnitTests
14+
registerUnitTests,
1515
// registerTypeORMTests
1616
).then(setResults)
1717
}, [])

example/src/tests/MochaRNAdapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const clearTests = () => {
1616

1717
export const it = (
1818
name: string,
19-
f: MochaTypes.Func | MochaTypes.AsyncFunc
19+
f: MochaTypes.Func | MochaTypes.AsyncFunc,
2020
): void => {
2121
if (!only) {
2222
const test = new Mocha.Test(name, f)
@@ -26,7 +26,7 @@ export const it = (
2626

2727
export const itOnly = (
2828
name: string,
29-
f: MochaTypes.Func | MochaTypes.AsyncFunc
29+
f: MochaTypes.Func | MochaTypes.AsyncFunc,
3030
): void => {
3131
clearTests()
3232
const test = new Mocha.Test(name, f)

0 commit comments

Comments
 (0)