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

Commit

Permalink
release: 0.10.0 (#3287)
Browse files Browse the repository at this point in the history
Co-authored-by: Micha Reiser <[email protected]>
  • Loading branch information
ematipico and MichaReiser authored Oct 4, 2022
1 parent 66ab560 commit 8c69826
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 103 deletions.
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,75 @@
# Rome changelog

### 0.10.0

### Core

- Rome is now faster and uses less memory on macOS and Linux systems! [#3237](https://github.com/rome/tools/pull/3237)
- We completely revamped our diagnostics! The new diagnostics allow us to give better information about the errors generated by Rome.
- Greatly increased the performance of Rome's daemon, up to 300%! [#3151](https://github.com/rome/tools/pull/3151)

### Configuration

You can now ignore folders and files using the Unix shell style patterns:

```json
{
"formatter": {
"ignore": ["scripts/*.js"]
},
"linter": {
"ignore": ["src/**.test.{ts,js}"]
}
}
```

### Formatter

- Completely revamped how the formatter handles comments and their placement inside the code [#3277](https://github.com/rome/tools/pull/3227)
- Improved formatting of intersection and unions types [#3162](https://github.com/rome/tools/issues/3162)
- Improved formatting of member chains [#3283](https://github.com/rome/tools/pull/3283)
- Improved formatting of call arguments [#3290](https://github.com/rome/tools/pull/3290)

### Linter

- **BREAKING CHANGE**: This release changes the naming of the lint rule groups with the goal to make them language agnostic and avoid confusion among users and contributors.
were named after a language, and this caused confusion among users and contributors. Please
check our [website](https://rome.tools/docs/lint/rules/) to know better about the new groups.
The new groups are heavily inspired from [`clippy`](https://github.com/rust-lang/rust-clippy#clippy)
- Added a new group called `nursery`, this group incubates new rules that are being developed.
- Added a new group called `style`, this group incubates rules that orbits around styling.
- Added a new group called `correctness`, this group incubates rules that orbits catching possible bugs.
- Fixed a code action for `useBlockStatements` [#3199](https://github.com/rome/tools/issues/3199)
- Improved the rule `useCamelCase` [#3190](https://github.com/rome/tools/pull/3190) [#3210](https://github.com/rome/tools/pull/3210)
- Fixed invalid code action for `useOptionalChain` [#3257](https://github.com/rome/tools/issues/3257)
- Fixed bugs in `noUnusedVariables` [#3170](https://github.com/rome/tools/issues/3170), [#3316](https://github.com/rome/tools/pull/3316)

#### New rules

- [`useButtonType`](https://rome.tools/docs/lint/rules/useButtonType/)
- [`noRenderReturnValue`](https://rome.tools/docs/lint/rules/noRenderReturnValue/)
- [`noDangerouslySetInnerHtml`](https://rome.tools/docs/lint/rules/noDangerouslySetInnerHtml/)
- [`useOptionalChain`](https://rome.tools/docs/lint/rules/useOptionalChain/)
- [`useFragmentSyntax`](https://rome.tools/docs/lint/rules/useFragmentSyntax/)
- [`noUselessFragments`](https://rome.tools/docs/lint/rules/noUselessFragments/)
- [`noChildrenProp`](https://rome.tools/docs/lint/rules/noChildrenProp/)
- [`noArrayIndexKey`](https://rome.tools/docs/lint/rules/noArrayIndexKey/)
- [`noVoidElementsWithChildren`](https://rome.tools/docs/lint/rules/noVoidElementsWithChildren/)
- [`noUndeclaredVariables`](https://rome.tools/docs/lint/rules/noUndeclaredVariables/)
- [`noDangerouslySetInnerHtmlWithChildren`](https://rome.tools/docs/lint/rules/noDangerouslySetInnerHtmlWithChildren/)


### Parser

- Fixed an issue where the parser was _not_ emitting a diagnostic on a certain TypeScript syntax [#3115](https://github.com/rome/tools/issues/3115)

### VSCode

- The setting `lspBin` can be also expressed as **relative path**
- The rules have been added to the configuration schema, allowing users to receive autocomplete
when editing the `rome.json` for the [`rules`](https://rome.tools/#linterrulescorrectness) section


## 0.9.2

### CLI
Expand Down
2 changes: 1 addition & 1 deletion editors/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "rome",
"displayName": "Rome",
"description": "Rome LSP VS Code Extension",
"version": "0.14.1",
"version": "0.16.0",
"icon": "icon.png",
"activationEvents": [
"onLanguage:javascript",
Expand Down
2 changes: 1 addition & 1 deletion npm/rome/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rome",
"version": "0.9.2-next",
"version": "0.10.0-next",
"bin": "bin/rome",
"scripts": {
"postinstall": "node scripts/postinstall.js",
Expand Down
64 changes: 0 additions & 64 deletions website/src/_includes/docs/formatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,70 +136,6 @@ const expr = [
As you can see the first array, which has a suppression comment, is left untouched!
### Differences with Prettier/dprint
Our formatter uses a CST to implement its algorithms, as opposed to Prettier or dprint, which use an
AST. This means that it has to deal with a different set of problems e.g. comments and how to place them.
As you might know, comments can appear almost everywhere inside a program, which can make the implementation
of a formatter more difficult.
In a CST, comments are attached to tokens, so it's possible to extract this information when inspecting
a single node.
Considering these assumptions, the Rome team had to create some heuristics and concepts in order to
**consistently format comments inside a program**.
#### Comments
The placements of some comments might be different, for example in JavaScript functions and JavaScript classes.
A function has a "head" and a "body":
- the head is where we define the name of the function and its signature (its parameters, return type, etc.);
- the body is where we define the implementation of the function, usually - but not only - inside a block `{}`;
Our formatter marks a function head as a hard group, while the body is a normal group. This means that all
the comments inside the head are "pushed out" and moved outside it, making the formatting **always consistent**.
Here's an example against Prettier/dprint, we place comments inside the head of a function:
```js
function // something
a(b, c) {
let a = "f";
}
function a(b, c) // something
{
let a = "f";
}
```
This how Rome and Prettier format this code:
```js
// Rome
function a(b, c) {
// something
let a = "f";
}
function a(b, c) {
// something
let a = "f";
}
// Prettier/dprint
function // something
a(b, c) {
let a = "f";
}
function a(b, c) {
// something
let a = "f";
}
```
#### Migration from other formatters
Rome doesn't support a lot of options like other web formatters, which means that particular styles
Expand Down
75 changes: 38 additions & 37 deletions website/src/_includes/docs/project-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ We aim to offer everything out of the box and only introduce configuration if [a

Enables Rome's linter

#### `linter.ignore`

An array of Unix shell style patterns.

```json
{
"linter": {
"ignore": ["scripts/*.js"]
}
}
```


> Default: `true`
#### `linter.rules.recommended`
Expand All @@ -39,13 +52,13 @@ Enables the [recommended rules](/docs/lint/rules) for all the groups.
> Default: `true`

#### `linter.rules.js`
#### `linter.rules.correctness`

A list of rules for `JavaScript` category.
A list of rules for `Correctness` category.

#### `linter.rules.js.recommended`
#### `linter.rules.correctness.recommended`

Enables the [recommended rules](/docs/lint/rules) for the category `JavaScript`.
Enables the [recommended rules](/docs/lint/rules) for the category `Correctness`.

Example:

Expand All @@ -54,7 +67,7 @@ Example:
"linter": {
"enabled": true,
"rules": {
"js": {
"correctness": {
"noDebugger": "off"
}
}
Expand All @@ -64,13 +77,13 @@ Example:
```


#### `linter.rules.ts`
#### `linter.rules.style`

A list of rules for `TypeScript` category.
A list of rules for `Style` category.

#### `linter.rules.ts.recommended`
#### `linter.rules.style.recommended`

Enables the [recommended rules](/docs/lint/rules) for the category `TypeScript`.
Enables the [recommended rules](/docs/lint/rules) for the category `Style`.


Example:
Expand All @@ -80,8 +93,8 @@ Example:
"linter": {
"enabled": true,
"rules": {
"ts": {
"useShorthandArrayType": "off"
"style": {
"noNegationElse": "off"
}
}
}
Expand All @@ -90,13 +103,13 @@ Example:
```


#### `linter.rules.jsx`
#### `linter.rules.nursery`

A list of rules for `JSX` category.
A list of rules for `Nursery` category.

#### `linter.rules.jsx.recommended`
#### `linter.rules.nursery.recommended`

Enables the [recommended rules](/docs/lint/rules) for the category `JSX`.
Enables the [recommended rules](/docs/lint/rules) for the category `Nursery`.

Example:

Expand All @@ -105,46 +118,34 @@ Example:
"linter": {
"enabled": true,
"rules": {
"jsx": {
"noCommentText": "off"
"nursery": {
"noCommentText": "on"
}
}
}
}

```

#### `formatter.enabled`

#### `linter.rules.regex`
Enables Rome's formatter

A list of rules for `Regex` category.
> Default: `true`

#### `linter.rules.regex.recommended`
#### `formatter.ignore`

Enables the [recommended rules](/docs/lint/rules) for the category `Regex`.

Example:
An array of Unix shell style patterns.

```json
{
"linter": {
"enabled": true,
"rules": {
"regex": {
"noMultipleSpacesInRegularExpressionLiterals": "off"
}
}
"formatter": {
"ignore": ["scripts/*.js"]
}
}

```

#### `formatter.enabled`

Enables Rome's formatter

> Default: `true`

#### `formatter.indentStyle`

Expand Down

0 comments on commit 8c69826

Please sign in to comment.