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

Commit b8a4d87

Browse files
committed
more configuration
1 parent 551db2a commit b8a4d87

File tree

6 files changed

+59
-21
lines changed

6 files changed

+59
-21
lines changed

crates/rome_service/src/configuration/javascript.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ impl JavascriptConfiguration {
6868
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
6969
#[serde(rename_all = "camelCase", default, deny_unknown_fields)]
7070
pub struct JavascriptFormatter {
71-
/// The style for quotes. Defaults to double.
71+
/// The type of quotes used in JavaScript code. Defaults to double.
7272
#[bpaf(long("quote-style"), argument("double|single"), optional)]
7373
#[serde(skip_serializing_if = "Option::is_none")]
7474
pub quote_style: Option<QuoteStyle>,
75-
/// The style for JSX quotes. Defaults to double.
75+
/// The type of quotes used in JSX. Defaults to double.
7676
#[bpaf(long("jsx-quote-style"), argument("double|single"), optional)]
7777
#[serde(skip_serializing_if = "Option::is_none")]
7878
pub jsx_quote_style: Option<QuoteStyle>,

editors/vscode/configuration_schema.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

npm/backend-jsonrpc/src/workspace.ts

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

npm/rome/configuration_schema.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/src/pages/configuration.mdx

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,20 @@ match these patterns.
163163
"ignore": ["scripts/*.js"]
164164
}
165165
}
166+
```
167+
168+
### `files.allowUnknown`
169+
170+
Rome won't emit diagnostics if it encounters files that can't handle.
171+
172+
<CodeBlockHeader filename="rome.json" />
173+
174+
```json
175+
{
176+
"files": {
177+
"allowUnknown": true
178+
}
179+
}
166180
```
167181

168182
## `vcs`
@@ -429,13 +443,11 @@ The type of quote used when representing string literals. It can be `single` or
429443

430444
> Default: `double`
431445
432-
[//]: # (### `javascript.formatter.jsxQuoteStyle`)
446+
### `javascript.formatter.jsxQuoteStyle`
433447

434-
[//]: # ()
435-
[//]: # (The type of quote used when representing jsx string literals. It can be `single` or `double`.)
448+
The type of quote used when representing jsx string literals. It can be `single` or `double`.
436449

437-
[//]: # ()
438-
[//]: # (> Default: `double`)
450+
> Default: `double`
439451
440452
### `javascript.formatter.quoteProperties`
441453

@@ -460,6 +472,14 @@ It configures where the formatter prints semicolons:
460472

461473
> Default: `always`
462474
475+
### `javascript.formatter.arrowParentheses`
476+
477+
Whether to add non-necessary parentheses to arrow functions:
478+
- `always`, the parentheses are always added;
479+
- `asNeeded`, the parentheses are added only when they are needed;
480+
481+
> Default: `always`
482+
463483
Example:
464484

465485
<CodeBlockHeader filename="rome.json" />
@@ -486,3 +506,19 @@ A list of global names that Rome should ignore (analyzer, linter, etc.)
486506
}
487507
}
488508
```
509+
510+
### `json.parser.allowComments`
511+
512+
Enables the parsing of comments in JSON files.
513+
514+
<CodeBlockHeader filename="rome.json" />
515+
516+
```json
517+
{
518+
"json": {
519+
"parser": {
520+
"allowComments": true
521+
}
522+
}
523+
}
524+
```
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
// Run `ROME_VERSION=<version number> cargo codegen-website
22
// to generate a new schema
3-
import {readFileSync} from "fs";
4-
import {join, resolve} from "path"
3+
import { readFileSync } from "fs";
4+
import { join, resolve } from "path";
55

66
export function get() {
7-
const schemaPath = resolve(join("..", "npm", "rome", "configuration_schema.json"));
8-
const schema = readFileSync(schemaPath, "utf8")
7+
const schemaPath = resolve(
8+
join("..", "npm", "rome", "configuration_schema.json"),
9+
);
10+
const schema = readFileSync(schemaPath, "utf8");
911

1012
return new Response(schema, {
1113
status: 200,
1214
headers: {
13-
"content-type": "application/json"
14-
}
15-
})
16-
}
15+
"content-type": "application/json",
16+
},
17+
});
18+
}

0 commit comments

Comments
 (0)