Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,15 @@ const icebergOption: INamedOption<yargs.Options> = {
},
};

const fmtIgnoreJsOptionName: INamedOption<yargs.Options> = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets drop Name suffix for consistency. Options generally have option suffix, while name is generally used for strings.

name: "ignore-js-files",
option: {
describe: "If set, the formatter will not consider javascript files (.js)",
type: "boolean",
default: false,
},
};

const testConnectionOptionName = "test-connection";

const watchOptionName = "watch";
Expand Down Expand Up @@ -718,7 +727,8 @@ export function runCli() {
}
],
processFn: async argv => {
let actions = ["{definitions,includes}/**/*.{js,sqlx}"];
const extensions = argv[fmtIgnoreJsOptionName.name] ? "*.sqlx" : "*.{js,sqlx}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon?

let actions = [`{definitions,includes}/**/${extensions}`];
if (actionsOption.name in argv && argv[actionsOption.name].length > 0) {
actions = argv[actionsOption.name];
}
Expand Down