Add requestFlags to action advice
MODIFY
packages/@romejs/cli-diagnostics/printAdvice.ts
packages/@romejs/cli-diagnostics/printAdvice.ts
@@ -109,7 +109,10 @@ function printAction(
programName: 'rome',
commandName: item.command,
args: item.args,
- flags: item.flags,
+ flags: {
+ ...item.commandFlags,
+ ...item.requestFlags,
+ },
}, {type: 'none'}).sourceText;
opts.reporter.command(command);
return DID_PRINT;

MODIFY
packages/@romejs/core/client/review.ts
packages/@romejs/core/client/review.ts
@@ -123,7 +123,9 @@ export default async function review(
throw new Error();
}
- const requestFlags: Partial<ClientRequestFlags> = {};
+ const requestFlags: Partial<ClientRequestFlags> = {
+ ...action.requestFlags,
+ };
// If this command allows the allowDirty flag then set it
// The validation of the flag would have happened with the initial query
@@ -139,7 +141,7 @@ export default async function review(
const res = await client.query({
command: action.command,
args: action.args,
- commandFlags: action.flags,
+ commandFlags: action.commandFlags,
requestFlags,
}, 'master');
if (res.type === 'ERROR' || res.type === 'INVALID_REQUEST') {

MODIFY
packages/@romejs/diagnostics/types.ts
packages/@romejs/diagnostics/types.ts
@@ -12,6 +12,7 @@ import {Number0, Number1} from '@romejs/ob1';
import {JSONPropertyValue} from '@romejs/codec-json';
import {DiagnosticCategory} from './categories';
import {Dict} from '@romejs/typescript-helpers';
+import {ClientRequestFlags} from '@romejs/core';
export type DiagnosticFilter = {
category?: DiagnosticCategory;
@@ -133,8 +134,9 @@ export type DiagnosticAdviceAction = {
instruction: string;
noun: string;
command: string;
- flags: Dict<boolean | string | Array<string>>;
- args: Array<string>;
+ commandFlags?: Dict<boolean | string | Array<string>>;
+ requestFlags?: ClientRequestFlags;
+ args?: Array<string>;
};
export type DiagnosticAdviceCode = {

MODIFY
packages/@romejs/js-compiler/lint/decisions.ts
packages/@romejs/js-compiler/lint/decisions.ts
@@ -107,7 +107,7 @@ export function buildLintDecisionAdviceAction({
args: [filename],
noun,
instruction,
- flags: {
+ commandFlags: {
decision,
},
};

Add requestFlags to action advice