From d68f322e1493f9114e3ac4fbc25d503fa71ebd1d Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Sun, 30 Apr 2023 13:35:59 +0100 Subject: [PATCH] chore: update CLI help --- npm/rome/package.json | 5 +- website/src/pages/cli.mdx | 27 +++++++- website/src/pages/formatter/index.mdx | 69 ++++++++++++------- .../src/pages/internals/language_support.mdx | 2 +- website/src/pages/linter/index.mdx | 59 +++++++++++----- 5 files changed, 114 insertions(+), 48 deletions(-) diff --git a/npm/rome/package.json b/npm/rome/package.json index e2488b25a30..d054e231cbb 100644 --- a/npm/rome/package.json +++ b/npm/rome/package.json @@ -1,6 +1,6 @@ { "name": "rome", - "version": "12.0.0", + "version": "12.1.0", "bin": "bin/rome", "scripts": { "postinstall": "node scripts/postinstall.js" @@ -26,7 +26,8 @@ "TypeScript", "format", "lint", - "toolchain" + "toolchain", + "JSON" ], "engines": { "node": ">=14.*" diff --git a/website/src/pages/cli.mdx b/website/src/pages/cli.mdx index ad7f1d5dac6..1a925994617 100644 --- a/website/src/pages/cli.mdx +++ b/website/src/pages/cli.mdx @@ -51,6 +51,10 @@ Start the Rome [daemon](/internals/architecture#daemon) server Stop the Rome [daemon](/internals/architecture#deamon) server +### `rome migrate` + +Automatically updates the configuration file to use the latest version, in case there were breaking changes among versions. + ## Global Options ### `--colors` @@ -79,10 +83,29 @@ Tell Rome in which path to find the configuration file `rome.json`. If Rome doesn't find a `rome.json`, it will abort the operation and exit with and error code. +### `--vcs-enabled` -## Global Options +Whether Rome should integrate itself with the VCS client. + +### `--vcs-client-kind` + +The kind of VCS client rome should support. + +Options available: +- `git` + +### `--vcs-use-ignore-file` + +Whether Rome should use the VCS ignore file. When [true], Rome will ignore the files specified in the ignore file. + +### `--vcs-root` + +The folder where Rome should check for VCS files. By default, Rome will use the same +folder where `rome.json` was found. + +If Rome can't fine the configuration, it will attempt to use the current working directory. +If no current working directory can't be found, Rome won't use the VCS integration. -Use these flags to get information about the Rome CLI. ### `--version` diff --git a/website/src/pages/formatter/index.mdx b/website/src/pages/formatter/index.mdx index b2226cd4bab..a5dec830b6b 100644 --- a/website/src/pages/formatter/index.mdx +++ b/website/src/pages/formatter/index.mdx @@ -31,32 +31,49 @@ You can start by running the CLI with the `--help` flag: Which will show you the options available at the moment: ```plaintext -Rome Formatter - -USAGE: - rome format [OPTIONS] - - INPUTS can be one or more filesystem path, each pointing to a single file or an entire directory to be searched recursively for supported files - -EXAMPLES: - rome format ./scripts/file.js - rome format ./ - rome format ./src ./internal ./scripts - -OPTIONS: - --write Edit the files in place (beware!) instead of printing the diff to the console - --skip-errors Skip over files containing syntax errors instead of emitting an error diagnostic. - --max-diagnostics Cap the amount of diagnostics displayed (default: 50) - --config-path Set the filesystem path to the directory of the rome.json configuration file - --verbose Print additional verbose advices on diagnostics - --indent-style Change the indention character (default: tab) - --indent-size If the indentation style is set to spaces, determine how many spaces should be used for indentation (default: 2) - --line-width Change how many characters the formatter is allowed to print in a single line (default: 80) - --quote-style Changes the quotation character for strings (default: double) - --quote-properties Changes when properties in object should be quoted (default: as-needed) - --trailing-comma Changes trailing commas in multi-line comma-separated syntactic structures (default: all) - --semicolons Changes when to print semicolons for statements (default: always) - --stdin-file-path A file name with its extension to pass when reading from standard in, e.g. echo 'let a;' | rome format --stdin-file-path file.js +Run the formatter on a set of files. + +Usage: [--write] ... + +Available positional items: + Single file, single path or list of paths + +Available options: + --indent-style The indent style. + --indent-size The size of the indentation, 2 by default + --line-width What's the max width of a line. Defaults to 80. + --quote-style The style for quotes. Defaults to double. + --quote-properties When properties in objects are quoted. Defaults to + asNeeded. + --trailing-comma Print trailing commas wherever possible in multi-line + comma-separated syntactic structures. Defaults to "all". + --semicolons Whether the formatter prints semicolons for all statements + or only in for statements where it is necessary because of ASI. + --vcs-client-kind The kind of client. + --vcs-enabled Whether Rome should integrate itself with the VCS client + --vcs-use-ignore-file Whether Rome should use the VCS ignore file. When [true], + Rome will ignore the files specified in the ignore file. + --vcs-root The folder where Rome should check for VCS files. By default, Rome will + use the same folder where `rome.json` was found. If Rome can't fine the + configuration, it will attempt to use the current working directory. If no + current working directory can't be found, Rome won't use the VCS integration. + --files-max-size The maximum allowed size for source code files in bytes. Files + above this limit will be ignored for performance reason. Defaults to 1 MiB + --stdin-file-path A file name with its extension to pass when reading from standard + in, e.g. echo 'let a;' | rome format --stdin-file-path=file.js" + --colors Set the formatting mode for markup: "off" prints everything as plain + text, "force" forces the formatting of markup using ANSI even if the console + output is determined to be incompatible + --use-server Connect to a running instance of the Rome daemon server. + --verbose Print additional verbose advices on diagnostics + --config-path Set the filesystem path to the directory of the rome.json configuration + file + --max-diagnostics Cap the amount of diagnostics displayed (default: 20) + --skip-errors Skip over files containing syntax errors instead of emitting an error + diagnostic. + --json Reports information using the JSON format + --write + -h, --help Prints help information ``` ## Configuration diff --git a/website/src/pages/internals/language_support.mdx b/website/src/pages/internals/language_support.mdx index 1fe49921205..ca3ea5a129e 100644 --- a/website/src/pages/internals/language_support.mdx +++ b/website/src/pages/internals/language_support.mdx @@ -27,6 +27,6 @@ Rome supports only the official syntax. The team starts development of the new s ## TypeScript support -Rome supports TypeScript version 4.7. +Rome supports TypeScript version 5.0. Rome can handle programs using decorators but doesn't support formatting or linting decorators. diff --git a/website/src/pages/linter/index.mdx b/website/src/pages/linter/index.mdx index a9ca8a16701..1260df4e0de 100644 --- a/website/src/pages/linter/index.mdx +++ b/website/src/pages/linter/index.mdx @@ -20,24 +20,49 @@ You can start by running the CLI with the `--help` flag: Which will show you the options available at the moment: ```plaintext -Rome Check: Run the linter on a set of files +Run various checks on a set of files. + +Usage: [--apply] [--apply-unsafe] ... + +Available positional items: + Single file, single path or list of paths + +Available options: + --apply Apply safe fixes, formatting + --apply-unsafe Apply safe fixes and unsafe fixes, formatting and import sorting + --vcs-client-kind The kind of client. + --vcs-enabled Whether Rome should integrate itself with the VCS client + --vcs-use-ignore-file Whether Rome should use the VCS ignore file. When [true], + Rome will ignore the files specified in the ignore file. + --vcs-root The folder where Rome should check for VCS files. By default, Rome will + use the same folder where `rome.json` was found. If Rome can't fine the + configuration, it will attempt to use the current working directory. If no + current working directory can't be found, Rome won't use the VCS integration. + --files-max-size The maximum allowed size for source code files in bytes. Files + above this limit will be ignored for performance reason. Defaults to 1 MiB + --indent-style The indent style. + --indent-size The size of the indentation, 2 by default + --line-width What's the max width of a line. Defaults to 80. + --quote-style The style for quotes. Defaults to double. + --quote-properties When properties in objects are quoted. Defaults to + asNeeded. + --trailing-comma Print trailing commas wherever possible in multi-line + comma-separated syntactic structures. Defaults to "all". + --semicolons Whether the formatter prints semicolons for all statements + or only in for statements where it is necessary because of ASI. + --colors Set the formatting mode for markup: "off" prints everything as plain + text, "force" forces the formatting of markup using ANSI even if the console + output is determined to be incompatible + --use-server Connect to a running instance of the Rome daemon server. + --verbose Print additional verbose advices on diagnostics + --config-path Set the filesystem path to the directory of the rome.json configuration + file + --max-diagnostics Cap the amount of diagnostics displayed (default: 20) + --skip-errors Skip over files containing syntax errors instead of emitting an error + diagnostic. + --json Reports information using the JSON format + -h, --help Prints help information -USAGE: - rome check - - INPUTS can be one or more filesystem paths, each pointing to a single file or an entire directory. - -EXAMPLES: - rome check ./scripts/file.js - rome check ./ - rome check ./src ./internal ./scripts - -OPTIONS: - --apply Apply safe fixes - --apply-unsafe Apply safe and unsafe fixes - --max-diagnostics Cap the amount of diagnostics displayed (default: 20) - --config-path Set the filesystem path to the directory of the rome.json configuration file - --verbose Print additional verbose advices on diagnostics ```