Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
chore: update CLI help
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Apr 30, 2023
1 parent c04bd18 commit 95c327f
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 48 deletions.
5 changes: 3 additions & 2 deletions npm/rome/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rome",
"version": "12.0.0",
"version": "12.1.0",
"bin": "bin/rome",
"scripts": {
"postinstall": "node scripts/postinstall.js"
Expand All @@ -26,7 +26,8 @@
"TypeScript",
"format",
"lint",
"toolchain"
"toolchain",
"JSON"
],
"engines": {
"node": ">=14.*"
Expand Down
27 changes: 25 additions & 2 deletions website/src/pages/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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`

Expand Down
69 changes: 43 additions & 26 deletions website/src/pages/formatter/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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...>
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 <tab|space> Change the indention character (default: tab)
--indent-size <number> If the indentation style is set to spaces, determine how many spaces should be used for indentation (default: 2)
--line-width <number> Change how many characters the formatter is allowed to print in a single line (default: 80)
--quote-style <single|double> Changes the quotation character for strings (default: double)
--quote-properties <as-needed|preserve> Changes when properties in object should be quoted (default: as-needed)
--trailing-comma <all|es5|none> Changes trailing commas in multi-line comma-separated syntactic structures (default: all)
--semicolons <always|as-needed> Changes when to print semicolons for statements (default: always)
--stdin-file-path <string> 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] <PATH>...
Available positional items:
<PATH> Single file, single path or list of paths
Available options:
--indent-style <tab|space> The indent style.
--indent-size <NUMBER> The size of the indentation, 2 by default
--line-width <NUMBER> What's the max width of a line. Defaults to 80.
--quote-style <double|single> The style for quotes. Defaults to double.
--quote-properties <preserve|as-needed> When properties in objects are quoted. Defaults to
asNeeded.
--trailing-comma <all|es5|none> Print trailing commas wherever possible in multi-line
comma-separated syntactic structures. Defaults to "all".
--semicolons <always|as-needed> Whether the formatter prints semicolons for all statements
or only in for statements where it is necessary because of ASI.
--vcs-client-kind <git> The kind of client.
--vcs-enabled <true|false> Whether Rome should integrate itself with the VCS client
--vcs-use-ignore-file <true|false> Whether Rome should use the VCS ignore file. When [true],
Rome will ignore the files specified in the ignore file.
--vcs-root <PATH> 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 <NUMBER> 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 <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 <off|force> 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 <PATH> Set the filesystem path to the directory of the rome.json configuration
file
--max-diagnostics <NUMBER> 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
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/internals/language_support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
59 changes: 42 additions & 17 deletions website/src/pages/linter/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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] <PATH>...
Available positional items:
<PATH> 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 <git> The kind of client.
--vcs-enabled <true|false> Whether Rome should integrate itself with the VCS client
--vcs-use-ignore-file <true|false> Whether Rome should use the VCS ignore file. When [true],
Rome will ignore the files specified in the ignore file.
--vcs-root <PATH> 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 <NUMBER> 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 <tab|space> The indent style.
--indent-size <NUMBER> The size of the indentation, 2 by default
--line-width <NUMBER> What's the max width of a line. Defaults to 80.
--quote-style <double|single> The style for quotes. Defaults to double.
--quote-properties <preserve|as-needed> When properties in objects are quoted. Defaults to
asNeeded.
--trailing-comma <all|es5|none> Print trailing commas wherever possible in multi-line
comma-separated syntactic structures. Defaults to "all".
--semicolons <always|as-needed> Whether the formatter prints semicolons for all statements
or only in for statements where it is necessary because of ASI.
--colors <off|force> 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 <PATH> Set the filesystem path to the directory of the rome.json configuration
file
--max-diagnostics <NUMBER> 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...>
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
```

Expand Down

0 comments on commit 95c327f

Please sign in to comment.