Skip to content

Commit

Permalink
feat: make mutate an option within fix mode (fixes #144)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Nov 12, 2019
1 parent 41ac1b5 commit 705af89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function main(argv: Array<string>): Promise<number> {
schemaOptions: {
coerce: args.coerce,
defaults: args.defaults,
mutate: mode === MODE.fix,
mutate: args.mutate,
},
});

Expand Down
5 changes: 5 additions & 0 deletions src/config/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface ParsedArgs extends RuleSelector, RuleSources {
defaults: boolean;
dest: string;
mode: string;
mutate: boolean;
source: string;
}

Expand Down Expand Up @@ -68,6 +69,10 @@ export async function parseArgs(argv: Array<string>): Promise<ParseResults> {
default: true,
type: 'boolean',
},
mutate: {
default: true,
type: 'boolean',
},
}),
command: ['fix'],
describe: 'validate the source document and insert defaults',
Expand Down

0 comments on commit 705af89

Please sign in to comment.