doc: add configuration for format and lint
MODIFY
website/src/_includes/docs/cli-commands.md
website/src/_includes/docs/cli-commands.md
@@ -35,7 +35,7 @@ Reformat all files without applying any fixes.
#### `rome config`
-Used to modify project configuration. These commands work with all Rome project config locations (see [supported locations](#supported-locations) for more info). When formatting a project config written with [RJSON](#rome-json), comments will be retained.
+Used to modify project configuration. These commands work with all Rome project config locations (see [supported locations](#supported-locations) for more info).
Before your project config is saved, we will validate it for errors. It is not possible to save an invalid config with `rome config`.

MODIFY
website/src/_includes/docs/project-config.md
website/src/_includes/docs/project-config.md
Your configuration can be placed in a [few different locations](#supported-locations), but we recommend using a single `rome.json` file.
-All properties are **optional**, you can even have an empty config! We recommend using the [`rome config`](#rome-config) command to modify your configuration, this works with any of the supported config locations, and when editing RJSON will even retain comments.
+All properties are **optional**, you can even have an empty config! We recommend using the [`rome config`](#rome-config) command to modify your configuration, this works with any of the supported config locations.
We are deliberately lean with the supported configuration. We do not include options just for the sake of personalization. We aim to offer everything out of the box and only introduce configuration if absolutely necessary.
@@ -66,6 +66,14 @@ This is a semver range of the Rome version you want to set your project to. It i
rome config set version "^0.0.0"
```
+#### `lint.enabled`
+
+Enables Rome's linter
+
+```bash
+rome config enable lint.enabled
+```
+
#### `lint.ignore`
[Path patterns](#path-patterns) that you want to ignore from linting.
@@ -90,6 +98,32 @@ Raise a diagnostic if a suppression does not have a [valid explanation](#explana
rome config enable lint.requireSuppressionExplanations
```
+### `format.enabled`
+
+Enables Rome's formatter
+
+```bash
+rome config enable format.enabled
+```
+
+### `format.indentStyle`
+
+The style of the indentation. It can be `"tab"` or `"space"`
+
+```bash
+rome config set format.indentStyle "tab"
+```
+
+Rome's default is `"tab"`.
+
+### `format.indentSize`
+
+How big the indentation should be. Rome's default is `1`.
+
+```bash
+rome config set format.indentSize 4
+```
+
### `dependencies.exceptions`
Exception rules for your dependencies that don't pass validation.
@@ -228,12 +262,6 @@ You can specify your project config in a few different places.
This is the recommended location. It's the file we create when running `rome init`.
-It can contain Rome's flavor of JSON, [RJSON](#rome-json), that allows comments and simpler syntax.
-
-##### `.config/rome.json`
-
-You can also use `rome.json` with regular JSON. This is useful if you think you might want to process and manipulate project configuration with another tool or language.
-
##### `package.json` field
Alternatively, your project config can be included in a `rome` field inside of `package.json`:
@@ -243,7 +271,11 @@ Alternatively, your project config can be included in a `rome` field inside of `
"name": "my-package",
"version": "0.0.0",
"rome": {
- "version": "^0.0.1"
+ "root": true,
+ "version": "^0.0.1",
+ "lint": {
+ "enabled": false
+ }
}
}
```

doc: add configuration for format and lint (#1631)