Skip to content

Commit b5bd0ad

Browse files
author
John Doe
committed
refactor: fix lint
1 parent be0b7fd commit b5bd0ad

File tree

7 files changed

+14
-16
lines changed

7 files changed

+14
-16
lines changed

packages/nx-plugin/src/executors/cli/executor.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type ExecutorContext } from '@nx/devkit';
1+
import type { ExecutorContext } from '@nx/devkit';
22
import { executeProcess } from '../../internal/execute-process.js';
33
import type { AutorunCommandExecutorOptions } from './schema.js';
44

@@ -8,13 +8,13 @@ export type ExecutorOutput = {
88
error?: Error;
99
};
1010

11+
/* eslint-disable max-lines-per-function */
1112
export default async function runAutorunExecutor(
1213
terminalAndExecutorOptions: AutorunCommandExecutorOptions,
1314
{ cwd }: ExecutorContext,
1415
): Promise<ExecutorOutput> {
1516
const { logger, stringifyError, objectToCliArgs, formatCommand } =
1617
await import('@code-pushup/utils');
17-
1818
const {
1919
dryRun,
2020
verbose,
@@ -23,7 +23,6 @@ export default async function runAutorunExecutor(
2323
bin,
2424
...argsObj
2525
} = terminalAndExecutorOptions;
26-
2726
const command = bin ? `node` : 'npx';
2827
const positionals = [
2928
bin ?? '@code-pushup/cli',
@@ -35,7 +34,6 @@ export default async function runAutorunExecutor(
3534
...env,
3635
...(verbose && { CP_VERBOSE: 'true' }),
3736
};
38-
3937
const binString = `${command} ${positionals.join(' ')} ${args.join(' ')}`;
4038
const formattedBinString = formatCommand(binString, {
4139
env: envVariables,
@@ -67,3 +65,4 @@ export default async function runAutorunExecutor(
6765
command: formattedBinString,
6866
};
6967
}
68+
/* eslint-enable max-lines-per-function */

packages/nx-plugin/src/executors/internal/cli.ts

Whitespace-only changes.

packages/nx-plugin/src/executors/internal/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function globalConfig(
2323

2424
export function persistConfig(
2525
options: Partial<PersistConfig & ProjectExecutorOnlyOptions>,
26-
context: BaseNormalizedExecutorContext,
26+
_context: BaseNormalizedExecutorContext,
2727
): Partial<PersistConfig> {
2828
const {
2929
format,

packages/nx-plugin/src/plugin/target/configuration-target.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ export async function createConfigurationTarget(options?: {
1010
const args = objectToCliArgs({
1111
...(projectName ? { project: projectName } : {}),
1212
});
13-
const argsString = args.length > 0 ? args.join(' ') : '';
14-
const baseCommand = `nx g ${PACKAGE_NAME}:configuration`;
13+
const argsString = args.length > 0 ? ` ${args.join(' ')}` : '';
1514
return {
16-
command: `nx g ${PACKAGE_NAME}:configuration${args.length > 0 ? ` ${args.join(' ')}` : ''}`,
15+
command: `nx g ${PACKAGE_NAME}:configuration${argsString}`,
1716
};
1817
}

packages/nx-plugin/src/plugin/target/configuration.target.unit.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import { createConfigurationTarget } from './configuration-target.js';
44

55
describe('createConfigurationTarget', () => {
66
it('should return code-pushup--configuration target for given project', async () => {
7-
expect(
8-
await createConfigurationTarget({ projectName: 'my-project' }),
9-
).toStrictEqual({
7+
await expect(
8+
createConfigurationTarget({ projectName: 'my-project' }),
9+
).resolves.toStrictEqual({
1010
command: `nx g ${PACKAGE_NAME}:configuration --project="my-project"`,
1111
});
1212
});
1313

1414
it('should return code-pushup--configuration target without project name', async () => {
15-
expect(await createConfigurationTarget()).toStrictEqual({
15+
await expect(createConfigurationTarget()).resolves.toStrictEqual({
1616
command: `nx g ${PACKAGE_NAME}:configuration`,
1717
});
1818
});

packages/utils/src/lib/logger.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,9 @@ export function formatCommand(
554554
const cwdPrefix = cwd ? ansis.blue(cwd) : '';
555555
const envString =
556556
options?.env && Object.keys(options.env).length > 0
557-
? Object.entries(options.env).map(([key, value]) => {
558-
return ansis.gray(`${key}="${value}"`);
559-
})
557+
? Object.entries(options.env).map(([key, value]) =>
558+
ansis.gray(`${key}="${value}"`),
559+
)
560560
: [];
561561
const statusColor =
562562
status === 'pending'

packages/utils/src/lib/transform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function objectToCliArgs<
102102
return [`${prefix}${value ? '' : 'no-'}${key}`];
103103
}
104104

105-
if (value === null || value === undefined) {
105+
if (value == null) {
106106
return [];
107107
}
108108

0 commit comments

Comments
 (0)