Skip to content

Commit 234c927

Browse files
committed
removed trailing comma from linter
1 parent 3a1ac34 commit 234c927

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+598
-595
lines changed

apps/test-app/App.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
ConnectionText,
44
MochaRemoteProvider,
55
StatusEmoji,
6-
StatusText,
6+
StatusText
77
} from "mocha-remote-react-native";
88
// biome-ignore lint/correctness/noUnusedImports: Keep React
99
import React from "react";
@@ -12,7 +12,7 @@ import { SafeAreaView, StyleSheet, View } from "react-native";
1212
function describeIf(
1313
condition: boolean,
1414
title: string,
15-
fn: (this: Mocha.Suite) => void,
15+
fn: (this: Mocha.Suite) => void
1616
) {
1717
return condition ? describe(title, fn) : describe.skip(title, fn);
1818
}
@@ -26,11 +26,11 @@ type Context = {
2626
function loadTests({
2727
allTests = false,
2828
nodeAddonExamples = allTests,
29-
ferricExample = allTests,
29+
ferricExample = allTests
3030
}: Context) {
3131
describeIf(nodeAddonExamples, "Node Addon Examples", () => {
3232
for (const [suiteName, examples] of Object.entries(
33-
nodeAddonExamplesSuites,
33+
nodeAddonExamplesSuites
3434
)) {
3535
describe(suiteName, () => {
3636
for (const [exampleName, requireExample] of Object.entries(examples)) {
@@ -74,24 +74,24 @@ export default function App() {
7474
const styles = StyleSheet.create({
7575
container: {
7676
flex: 1,
77-
backgroundColor: "#fff",
77+
backgroundColor: "#fff"
7878
},
7979
statusContainer: {
8080
flex: 1,
8181
alignItems: "center",
82-
justifyContent: "center",
82+
justifyContent: "center"
8383
},
8484
statusEmoji: {
8585
fontSize: 30,
8686
margin: 30,
87-
textAlign: "center",
87+
textAlign: "center"
8888
},
8989
statusText: {
9090
fontSize: 20,
9191
margin: 20,
92-
textAlign: "center",
92+
textAlign: "center"
9393
},
9494
connectionText: {
95-
textAlign: "center",
96-
},
95+
textAlign: "center"
96+
}
9797
});

apps/test-app/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
presets: ["module:@react-native/babel-preset"],
33
// plugins: [['module:react-native-node-api/babel-plugin', { stripPathSuffix: true }]],
4-
plugins: ["module:react-native-node-api/babel-plugin"],
4+
plugins: ["module:react-native-node-api/babel-plugin"]
55
};

apps/test-app/metro.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ module.exports = makeMetroConfig({
44
getTransformOptions: async () => ({
55
transform: {
66
experimentalImportSupport: false,
7-
inlineRequires: false,
8-
},
9-
}),
10-
},
7+
inlineRequires: false
8+
}
9+
})
10+
}
1111
});

apps/test-app/react-native.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ const project = (() => {
33
const { configureProjects } = require("react-native-test-app");
44
const project = configureProjects({
55
android: {
6-
sourceDir: "android",
6+
sourceDir: "android"
77
},
88
ios: {
99
sourceDir: "ios",
10-
automaticPodsInstallation: false,
11-
},
10+
automaticPodsInstallation: false
11+
}
1212
// windows: {
1313
// sourceDir: "windows",
1414
// solutionFile: "windows/react-native-node-api-example.sln",
1515
// },
1616
});
1717
return {
18-
...project,
18+
...project
1919
};
2020
} catch {
2121
return undefined;
2222
}
2323
})();
2424

2525
module.exports = {
26-
...(project ? { project } : undefined),
26+
...(project ? { project } : undefined)
2727
};

biome.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
"enabled": true,
2525
"indentStyle": "space"
2626
},
27+
"javascript": {
28+
"formatter": {
29+
"trailingCommas": "none"
30+
}
31+
},
2732
"linter": {
2833
"enabled": true,
2934
"rules": {

packages/cmake-rn/src/cli.ts

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
allTargets,
1414
findPlatformForTarget,
1515
platformHasTarget,
16-
platforms,
16+
platforms
1717
} from "./platforms.js";
1818
import { getWeakNodeApiVariables } from "./weak-node-api.js";
1919

@@ -24,12 +24,12 @@ EventEmitter.defaultMaxListeners = 100;
2424

2525
const verboseOption = new Option(
2626
"--verbose",
27-
"Print more output during the build",
27+
"Print more output during the build"
2828
).default(process.env.CI === "true");
2929

3030
const sourcePathOption = new Option(
3131
"--source <path>",
32-
"Specify the source directory containing a CMakeLists.txt file",
32+
"Specify the source directory containing a CMakeLists.txt file"
3333
).default(process.cwd());
3434

3535
// TODO: Add "MinSizeRel" and "RelWithDebInfo"
@@ -47,40 +47,40 @@ const defaultTargets = CMAKE_RN_TARGETS ? CMAKE_RN_TARGETS.split(",") : [];
4747
for (const target of defaultTargets) {
4848
assert(
4949
(allTargets as string[]).includes(target),
50-
`Unexpected target in CMAKE_RN_TARGETS: ${target}`,
50+
`Unexpected target in CMAKE_RN_TARGETS: ${target}`
5151
);
5252
}
5353

5454
const targetOption = new Option("--target <target...>", "Targets to build for")
5555
.choices(allTargets)
5656
.default(
5757
defaultTargets,
58-
"CMAKE_RN_TARGETS environment variable split by ','",
58+
"CMAKE_RN_TARGETS environment variable split by ','"
5959
);
6060

6161
const buildPathOption = new Option(
6262
"--build <path>",
63-
"Specify the build directory to store the configured CMake project",
63+
"Specify the build directory to store the configured CMake project"
6464
);
6565

6666
const cleanOption = new Option(
6767
"--clean",
68-
"Delete the build directory before configuring the project",
68+
"Delete the build directory before configuring the project"
6969
);
7070

7171
const outPathOption = new Option(
7272
"--out <path>",
73-
"Specify the output directory to store the final build artifacts",
73+
"Specify the output directory to store the final build artifacts"
7474
).default(false, "./{build}/{configuration}");
7575

7676
const noAutoLinkOption = new Option(
7777
"--no-auto-link",
78-
"Don't mark the output as auto-linkable by react-native-node-api",
78+
"Don't mark the output as auto-linkable by react-native-node-api"
7979
);
8080

8181
const noWeakNodeApiLinkageOption = new Option(
8282
"--no-weak-node-api-linkage",
83-
"Don't pass the path of the weak-node-api library from react-native-node-api",
83+
"Don't pass the path of the weak-node-api library from react-native-node-api"
8484
);
8585

8686
let program = new Command("cmake-rn")
@@ -98,7 +98,7 @@ let program = new Command("cmake-rn")
9898
for (const platform of platforms) {
9999
const allOption = new Option(
100100
`--${platform.id}`,
101-
`Enable all ${platform.name} triplets`,
101+
`Enable all ${platform.name} triplets`
102102
);
103103
program = program.addOption(allOption);
104104
program = platform.amendCommand(program);
@@ -132,13 +132,13 @@ program = program.action(
132132
}
133133
if (targets.size === 0) {
134134
throw new Error(
135-
"Found no default targets: Install some platform specific build tools",
135+
"Found no default targets: Install some platform specific build tools"
136136
);
137137
} else {
138138
console.error(
139139
chalk.yellowBright("ℹ"),
140140
"Using default targets",
141-
chalk.dim(`(${[...targets].join(", ")})`),
141+
chalk.dim(`(${[...targets].join(", ")})`)
142142
);
143143
}
144144
}
@@ -155,26 +155,26 @@ program = program.action(
155155
platform,
156156
buildPath: targetBuildPath,
157157
outputPath: path.join(targetBuildPath, "out"),
158-
options: baseOptions,
158+
options: baseOptions
159159
};
160160
});
161161

162162
// Configure every triplet project
163163
const targetsSummary = chalk.dim(
164-
`(${getTargetsSummary(targetContexts)})`,
164+
`(${getTargetsSummary(targetContexts)})`
165165
);
166166
await oraPromise(
167167
Promise.all(
168168
targetContexts.map(({ platform, ...context }) =>
169-
configureProject(platform, context, baseOptions),
170-
),
169+
configureProject(platform, context, baseOptions)
170+
)
171171
),
172172
{
173173
text: `Configuring projects ${targetsSummary}`,
174174
isSilent: baseOptions.verbose,
175175
successText: `Configured projects ${targetsSummary}`,
176-
failText: ({ message }) => `Failed to configure projects: ${message}`,
177-
},
176+
failText: ({ message }) => `Failed to configure projects: ${message}`
177+
}
178178
);
179179

180180
// Build every triplet project
@@ -185,33 +185,33 @@ program = program.action(
185185
// This is important, since we might rename the output files
186186
await fs.promises.rm(context.outputPath, {
187187
recursive: true,
188-
force: true,
188+
force: true
189189
});
190190
await buildProject(platform, context, baseOptions);
191-
}),
191+
})
192192
),
193193
{
194194
text: "Building projects",
195195
isSilent: baseOptions.verbose,
196196
successText: "Built projects",
197-
failText: ({ message }) => `Failed to build projects: ${message}`,
198-
},
197+
failText: ({ message }) => `Failed to build projects: ${message}`
198+
}
199199
);
200200

201201
// Perform post-build steps for each platform in sequence
202202
for (const platform of platforms) {
203203
const relevantTargets = targetContexts.filter(({ target }) =>
204-
platformHasTarget(platform, target),
204+
platformHasTarget(platform, target)
205205
);
206206
if (relevantTargets.length === 0) {
207207
continue;
208208
}
209209
await platform.postBuild(
210210
{
211211
outputPath: baseOptions.out || baseOptions.source,
212-
targets: relevantTargets,
212+
targets: relevantTargets
213213
},
214-
baseOptions,
214+
baseOptions
215215
);
216216
}
217217
} catch (error) {
@@ -220,11 +220,11 @@ program = program.action(
220220
}
221221
throw error;
222222
}
223-
},
223+
}
224224
);
225225

226226
function getTargetsSummary(
227-
targetContexts: { target: string; platform: Platform }[],
227+
targetContexts: { target: string; platform: Platform }[]
228228
) {
229229
const targetsPerPlatform: Record<string, string[]> = {};
230230
for (const { target, platform } of targetContexts) {
@@ -256,7 +256,7 @@ function getTargetBuildPath(buildPath: string, target: unknown) {
256256
async function configureProject<T extends string>(
257257
platform: Platform<T[], Record<string, unknown>>,
258258
context: TargetContext<T>,
259-
options: BaseOpts,
259+
options: BaseOpts
260260
) {
261261
const { target, buildPath, outputPath } = context;
262262
const { verbose, source, weakNodeApiLinkage } = options;
@@ -269,7 +269,7 @@ async function configureProject<T extends string>(
269269

270270
const declarations = {
271271
...nodeApiVariables,
272-
CMAKE_LIBRARY_OUTPUT_DIRECTORY: outputPath,
272+
CMAKE_LIBRARY_OUTPUT_DIRECTORY: outputPath
273273
};
274274

275275
await spawn(
@@ -280,19 +280,19 @@ async function configureProject<T extends string>(
280280
"-B",
281281
buildPath,
282282
...platform.configureArgs(context, options),
283-
...toDeclarationArguments(declarations),
283+
...toDeclarationArguments(declarations)
284284
],
285285
{
286286
outputMode: verbose ? "inherit" : "buffered",
287-
outputPrefix: verbose ? chalk.dim(`[${target}] `) : undefined,
288-
},
287+
outputPrefix: verbose ? chalk.dim(`[${target}] `) : undefined
288+
}
289289
);
290290
}
291291

292292
async function buildProject<T extends string>(
293293
platform: Platform<T[], Record<string, unknown>>,
294294
context: TargetContext<T>,
295-
options: BaseOpts,
295+
options: BaseOpts
296296
) {
297297
const { target, buildPath } = context;
298298
const { verbose, configuration } = options;
@@ -304,19 +304,19 @@ async function buildProject<T extends string>(
304304
"--config",
305305
configuration,
306306
"--",
307-
...platform.buildArgs(context, options),
307+
...platform.buildArgs(context, options)
308308
],
309309
{
310310
outputMode: verbose ? "inherit" : "buffered",
311-
outputPrefix: verbose ? chalk.dim(`[${target}] `) : undefined,
312-
},
311+
outputPrefix: verbose ? chalk.dim(`[${target}] `) : undefined
312+
}
313313
);
314314
}
315315

316316
function toDeclarationArguments(declarations: Record<string, string>) {
317317
return Object.entries(declarations).flatMap(([key, value]) => [
318318
"-D",
319-
`${key}=${value}`,
319+
`${key}=${value}`
320320
]);
321321
}
322322

0 commit comments

Comments
 (0)