id = "prettier" name = "Prettier" description = "Prettier is an opinionated code formatter for JavaScript, TypeScript, CSS, JSON, Markdown and more." homepage = "https://prettier.io" executables = ["prettier"] [commands] format = 1 label = "Format files" description = "Format or check files, directories or globs. Plugin, range and cursor options are left out." quality = "ai-draft" base = "fig:prettier" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/prettier.ts" license = "MIT" [[commands.field]] id = "targets" label = "Files, directories or globs" description = "Quote globs so the shell does not expand them." type = "string" position = 0 multiple = true min = 1 sources = ["fig"] [[commands.field]] id = "write" label = "Write changes in place" type = "boolean" option = ["--write"] effect = "overwrite" sources = ["fig"] [[commands.field]] id = "list_different" label = "List files that need formatting" type = "boolean" option = ["--list-different"] sources = ["fig"] [[commands.field]] id = "ignore_unknown" label = "Ignore unknown file types" type = "boolean" option = ["--ignore-unknown"] sources = ["fig"] [[commands.field]] id = "parser" label = "Parser" type = "string" option = ["--parser"] suggestions = [{ value = "babel", label = "babel" }, { value = "typescript", label = "typescript" }, { value = "css", label = "css" }, { value = "scss", label = "scss" }, { value = "json", label = "json" }, { value = "markdown", label = "markdown" }, { value = "graphql", label = "graphql" }] sources = ["fig"] [[commands.field]] id = "print_width" label = "Print width" type = "integer" option = ["--print-width"] sources = ["fig"] [[commands.field]] id = "tab_width" label = "Tab width" type = "integer" option = ["--tab-width"] sources = ["fig"] [[commands.field]] id = "use_tabs" label = "Indent with tabs" type = "boolean" option = ["--use-tabs"] sources = ["fig"] [[commands.field]] id = "single_quote" label = "Single quotes" type = "boolean" option = ["--single-quote"] sources = ["fig"] [[commands.field]] id = "no_semi" label = "No semicolons" type = "boolean" option = ["--no-semi"] sources = ["fig"] [[commands.field]] id = "trailing_comma" label = "Trailing commas" type = "enum" option = ["--trailing-comma"] choices = [{ value = "all", label = "All" }, { value = "es5", label = "ES5" }, { value = "none", label = "None" }] sources = ["fig"] [[commands.field]] id = "config" label = "Config file" type = "path" option = ["--config"] path = { kind = "file", role = "input", must_exist = true } sources = ["fig"] [[commands.task]] id = "write_all" label = "Format files in place" fields = ["targets", "write"] required = ["targets"] set = { write = [true] } [[commands.task]] id = "find_unformatted" label = "List unformatted files" fields = ["targets", "list_different"] required = ["targets"] set = { list_different = [true] } [[commands.group]] id = "basic" label = "Basic" fields = ["targets", "write", "list_different", "ignore_unknown"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["parser", "print_width", "tab_width", "use_tabs", "single_quote", "no_semi", "trailing_comma", "config"]