feat: make mutate an option within fix mode (fixes #144)
This commit is contained in:
parent
41ac1b5849
commit
705af893a3
|
@ -37,7 +37,7 @@ export async function main(argv: Array<string>): Promise<number> {
|
||||||
schemaOptions: {
|
schemaOptions: {
|
||||||
coerce: args.coerce,
|
coerce: args.coerce,
|
||||||
defaults: args.defaults,
|
defaults: args.defaults,
|
||||||
mutate: mode === MODE.fix,
|
mutate: args.mutate,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ export interface ParsedArgs extends RuleSelector, RuleSources {
|
||||||
defaults: boolean;
|
defaults: boolean;
|
||||||
dest: string;
|
dest: string;
|
||||||
mode: string;
|
mode: string;
|
||||||
|
mutate: boolean;
|
||||||
source: string;
|
source: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +69,10 @@ export async function parseArgs(argv: Array<string>): Promise<ParseResults> {
|
||||||
default: true,
|
default: true,
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
},
|
},
|
||||||
|
mutate: {
|
||||||
|
default: true,
|
||||||
|
type: 'boolean',
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
command: ['fix'],
|
command: ['fix'],
|
||||||
describe: 'validate the source document and insert defaults',
|
describe: 'validate the source document and insert defaults',
|
||||||
|
|
Loading…
Reference in New Issue