release: 10.0.0
MODIFY
.github/ISSUE_TEMPLATE/01_bug.yml
.github/ISSUE_TEMPLATE/01_bug.yml
@@ -15,8 +15,8 @@ body:
id: environment
attributes:
label: Environment information
- description: Please share any information about your environment that can help debug your issue (OS and OS version, CPU architecture, installation method, etc.).
- render: bash
+ description: Run the command `rome rage` and paste its output here. Please review it, in case there are sensitive information you don't want to share.
+ render: block
validations:
required: true
- type: textarea
@@ -25,7 +25,10 @@ body:
label: What happened?
description: |
Provide a detailed list of steps that reproduce the issue
- The more information and included steps, the quicker your report can be confirmed and addressed!
+ The more information and included steps, the quicker your report can be triaged and addressed!
+
+ You can also use the [playground](https://play.rome.tools) to share code snippets.
+ This is useful to reproduce the issue.
placeholder: |
1.
2.

MODIFY
CHANGELOG.md
CHANGELOG.md
# Rome changelog
+## 10.0.0
+
+### CLI
+
+- Added the new command `rome version`.
+- Added the new command `rome rage`.
+- Added the new command `rome lsp-proxy`.
+- Added the new option`--version` as an alias for `rome version`
+- Added a new argument `--files-max-size` to change the allowed size of files, in bytes.
+- Added a new argument `--formatter-enabled` to the command `rome ci`.
+- Added a new argument `--linter-enabled` to the command `rome ci`.
+- Added the new `format` option `--trailing-comma` to configure where to add trailing commas.
+- Correctly show the supported options for `rome ci`, closes [#3456](https://github.com/rome/tools/issues/3456).
+- Fixed the command `rome ci` command to run the linter even if the formatter is disabled, closes [#3495](https://github.com/rome/tools/issues/3495).
+- Fixed the messaging of some diagnostics, [#3460](https://github.com/rome/tools/pull/3460).
+
+### Configuration
+
+- Added `files.maxSize`, to change the allowed size of files, in bytes.
+
+### Diagnostics
+
+- Fix false positive for unknown lint rule in suppression comments during formatting [#3406](https://github.com/rome/tools/issues/3406).
+- Correctly handle empty lines when printing code diffs [#3375](https://github.com/rome/tools/issues/3375).
+
+
+### Formatter
+
+- Added the new trailing comma option that configures where to add trailing commas. Supports the values: `all`, `es5` and `none`; refer to the [documentation](https://rome.tools/docs/#javascriptformattertrailingcomma) to learn more.
+- Improved JSX formatting [#3499](https://github.com/rome/tools/issues/3499), [#3211](https://github.com/rome/tools/issues/3211), [#3377](https://github.com/rome/tools/issues/3377)
+- Better formatting of object destructing
+- Improved formatting of test calls
+- Fixed formatting of trailing comments in arrow functions
+
+### Linter
+
+- **BREAKING CHANGE**: some rules have been moved to new groups to better reflect their purpose. This may result in Rome failing to load your configuration or suppression comments that now refer to unknown rules. Please check out [#3471](https://github.com/rome/tools/pull/3471) to learn more about the affected rules.
+- Fixed issues in the `noUnreachable` rule
+- Fixed false positive cases for `noNegationElse` [#3141](https://github.com/rome/tools/issues/3141)
+- Fixed false positive cases for `noUnusedVariables` [#3169](https://github.com/rome/tools/issues/3169)
+- Fixed an issue in our CFG [#3390](https://github.com/rome/tools/issues/3390)
+
+#### New rules
+
+- [`noAutoFocus`](https://rome.tools/docs/lint/rules/noAutoFocus/)
+- [`useAltText`](https://rome.tools/docs/lint/rules/useAltText/)
+- [`noBlankTarget`](https://rome.tools/docs/lint/rules/noBlankTarget/)
+- [`useAnchorContent`](https://rome.tools/docs/lint/rules/useAnchorContent/)
+- [`useKeyWithClickEvents`](https://rome.tools/docs/lint/rules/useKeyWithClickEvents/)
+- [`useKeyWithMouseEvents`](https://rome.tools/docs/lint/rules/useKeyWithMouseEvents/)
+- [`noPositiveTabIndex`](https://rome.tools/docs/lint/rules/noPositiveTabIndex/)
+- [`useValidAnchor`](https://rome.tools/docs/lint/rules/useValidAnchor/)
+- [`noRestrictedGlobals`](https://rome.tools/docs/lint/rules/noRestrictedGlobals/)
+- [`useSimplifiedBooleanExpression`](https://rome.tools/docs/lint/rules/useSimplifiedBooleanExpression/)
+- [`noInvalidConstructorSuper`](https://rome.tools/docs/lint/rules/noInvalidConstructorSuper/)
+- [`useValidForDirection`](https://rome.tools/docs/lint/rules/useValidForDirection/)
+- [`noConstAssign`](https://rome.tools/docs/lint/rules/noConstAssign/)
+- [`noExplicitAny`](https://rome.tools/docs/lint/rules/noExplicitAny/)
+- [`noBannedTypes`](https://rome.tools/docs/lint/rules/noBannedTypes/)
+- [`useMapFlat`](https://rome.tools/docs/lint/rules/useMapFlat/)
+- [`useExhaustiveDependencies`](https://rome.tools/docs/lint/rules/useExhaustiveDependencies/)
+
+### Parser
+
+- Improved messaging of diagnostics, using our new infrastructure
+- Fixed an issue where diagnostics couldn't be printed in WASM [#3349](https://github.com/rome/tools/pull/3349)
+- Allow arguments in d.ts files [#3388](https://github.com/rome/tools/issues/3388)
+- Fix parsing of less than in optional call chains [#3486](https://github.com/rome/tools/issues/3486)
+- Fixed a case where `export {"a"} from "b";` wasn't correctly parsed
+
+### VSCode
+
+- Make the "rename" command opt-in and use the VS Code provided "rename" feature that offers whole project renaming instead.
+- Added the new command `Restart LSP Server`
+- The LSP server is now able to listen to changes of `rome.json` and apply the new configuration
+
+
+
## 0.10.1
### CLI

MODIFY
CONTRIBUTING.md
CONTRIBUTING.md
@@ -88,8 +88,8 @@ The npm module npm/rome contains Rome's Node JS API that supports different back
For testing and developing, you need to build these packages, following the steps:
1. install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) globally;
2. run the `build` command inside the package `backend-jsonrpc`;
-3. run the `build:wasm-node-dev` command inside the package `rome` (folder `npm/rome`);
-4. run `pnpm i` inside the package `rome` (folder `npm/rome`), this will link the WebAssembly bindings and the
+3. run the `build:wasm-node-dev` command inside the package `js-api` (folder `npm/js-api`);
+4. run `pnpm i` inside the package `js-api` (folder `npm/js-api`), this will link the WebAssembly bindings and the
JSON-RPC bindings;
The tests are run against the compiled files, which means that you need to run the

MODIFY
crates/rome_service/src/configuration/mod.rs
crates/rome_service/src/configuration/mod.rs
@@ -78,7 +78,7 @@ impl Configuration {
#[serde(rename_all = "camelCase", default, deny_unknown_fields)]
pub struct FilesConfiguration {
/// The maximum allowed size for source code files in bytes. Files above
- /// this limit will be ignore for performance reason. Defaults to 1 MiB
+ /// this limit will be ignored for performance reason. Defaults to 1 MiB
pub max_size: Option<NonZeroU64>,
}

MODIFY
editors/vscode/configuration_schema.json
editors/vscode/configuration_schema.json
"type": "object",
"properties": {
"maxSize": {
- "description": "The maximum allowed size for source code files in bytes. Files above this limit will be ignore for performance reason. Defaults to 1 MiB",
+ "description": "The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reason. Defaults to 1 MiB",
"default": null,
"type": [
"integer",

MODIFY
editors/vscode/package.json
editors/vscode/package.json
"publisher": "rome",
"displayName": "Rome",
"description": "Rome LSP VS Code Extension",
- "version": "0.16.1",
+ "version": "0.18.0",
"icon": "icon.png",
"activationEvents": [
"onLanguage:javascript",

MODIFY
npm/backend-jsonrpc/src/workspace.ts
npm/backend-jsonrpc/src/workspace.ts
@@ -49,7 +49,7 @@ export interface Configuration {
*/
export interface FilesConfiguration {
/**
- * The maximum allowed size for source code files in bytes. Files above this limit will be ignore for performance reason. Defaults to 1 MiB
+ * The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reason. Defaults to 1 MiB
*/
maxSize?: number;
}

MODIFY
npm/js-api/package.json
npm/js-api/package.json
{
"name": "@rometools/js-api",
- "version": "0.0.0",
+ "version": "0.1.0",
"description": "JavaScript APIs for the Rome package",
"scripts": {
"tsc": "tsc --noEmit",

MODIFY
npm/rome/README.md
npm/rome/README.md
[discord-url]: https://discord.gg/rome
[ci-badge]: https://github.com/rome/tools/actions/workflows/main.yml/badge.svg
[ci-url]: https://github.com/rome/tools/actions/workflows/main.yml
-[npm-badge]: https://img.shields.io/npm/v/rome/next?color=brightgreen
-[npm-url]: https://www.npmjs.com/package/rome/v/next
+[npm-badge]: https://img.shields.io/npm/v/rome/latest?color=brightgreen
+[npm-url]: https://www.npmjs.com/package/rome/v/latest
[vscode-badge]: https://img.shields.io/visual-studio-marketplace/v/rome.rome?color=brightgreen&label=vscode
[vscode-url]: (https://marketplace.visualstudio.com/items?itemName=rome.rome
</div>
-**Rome** is a formatter, linter, bundler, and [more](https://rome.tools/#development-status) for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS.
+**Rome** is a formatter, linter, bundler, and [more](https://rome.tools/) for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS.
**Rome** is designed to replace [Babel](https://babeljs.io/), [ESLint](https://eslint.org/), [webpack](https://webpack.js.org/), [Prettier](https://prettier.io/), [Jest](https://jestjs.io/), and others.
**Rome** unifies functionality that has previously been separate tools. Building upon a shared base allows us to provide a cohesive experience for processing code, displaying errors, parallelizing work, caching, and configuration.
-**Rome** has strong conventions and aims to have minimal configuration. Read more about our [project philosophy](https://rome.tools/#philosophy).
+**Rome** has strong conventions and aims to have minimal configuration. Read more about our [project philosophy](https://docs.rome.tools/internals/philosophy/).
-**Rome** is [written in Rust](https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust).
+**Rome** is [written in Rust](https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust.html).
**Rome** has first-class IDE support, with a sophisticated parser that represents the source text in full fidelity
and top-notch error recovery.
@@ -43,37 +43,13 @@ and top-notch error recovery.
**Rome** is [MIT licensed](https://github.com/rome/tools/tree/main/LICENSE) and moderated under the [Contributor Covenant Code of Conduct](https://github.com/rome/tools/tree/main/CODE_OF_CONDUCT.md).
-## Installation
+## Documentation
-```shell
-npm i rome@next
-```
-
-## Usage
-
-Format files:
-
-```shell
-rome format --write ./path ./path/to/file.js
-```
-
-For complete documentation, please visit the [official website].
-
-
-## Philosophy
-
-The project philosophy can be found on our [website](https://rome.tools/#philosophy).
-
-## Community
-
-Contribution and development instructions can be found in [CONTRIBUTING](./CONTRIBUTING.md).
-
-Additional project coordination and real-time discussion happens on our [Discord server](https://discord.gg/rome). Remember that all activity on the Discord server is still moderated and will be strictly enforced under the project's [Code of Conduct](./CODE_OF_CONDUCT.md).
+Check out our [homepage](https://rome.tools) to learn more about Rome, or directly head to the [Getting Started guide](https://docs.rome.tools/guides/getting-started/) if you want to start using Rome.
## Technical documentation
-If you're curious to know our internals, you can browse our [technical documentation].
+Browse Rome's internal [Rust API Documentation] if you're interested to learn more about how Rome works.
-[official website]: https://rome.tools/
-[technical documentation]: https://rome.github.io/tools/rome
+[Rust API Documentation]: https://rome.github.io/tools/rome

MODIFY
npm/rome/package.json
npm/rome/package.json
{
"name": "rome",
- "version": "0.10.1",
+ "version": "10.0.0",
"bin": "bin/rome",
"scripts": {
"postinstall": "node scripts/postinstall.js"

MODIFY
website/docs/src/guides/getting-started.md
website/docs/src/guides/getting-started.md
@@ -22,7 +22,7 @@ Run the following commands in a directory with a `package.json` file to install
#### npm
```bash
-npm install --save-dev rome@next
+npm install --save-dev rome
```
You can now use `npx rome` to run Rome.
@@ -30,7 +30,7 @@ You can now use `npx rome` to run Rome.
#### pnpm
```bash
-pnpm install --save-dev rome@next
+pnpm install --save-dev rome
```
You can now use `pnpm exec rome` to run Rome.
@@ -39,7 +39,7 @@ You can now use `pnpm exec rome` to run Rome.
#### yarn
```bash
-yarn add rome@next --save-dev
+yarn add rome --save-dev
```
You can now use `yarn run rome` to run Rome.

MODIFY
xtask/lintdoc/src/main.rs
xtask/lintdoc/src/main.rs
@@ -3,11 +3,13 @@ use rome_analyze::{
AnalysisFilter, AnalyzerOptions, ControlFlow, GroupCategory, Queryable, RegistryVisitor, Rule,
RuleCategory, RuleFilter, RuleGroup, RuleMetadata,
};
+use rome_console::fmt::Termcolor;
use rome_console::{
fmt::{Formatter, HTML},
- markup, Console, Markup,
+ markup, Console, Markup, MarkupBuf,
};
use rome_diagnostics::file::FileId;
+use rome_diagnostics::termcolor::NoColor;
use rome_diagnostics::v2::{Diagnostic, DiagnosticExt, PrintDiagnostic};
use rome_js_analyze::{analyze, visit_registry};
use rome_js_syntax::{JsLanguage, Language, LanguageVariant, ModuleKind, SourceType};
@@ -24,6 +26,8 @@ use xtask::{glue::fs2, *};
fn main() -> Result<()> {
let root = project_root().join("website/docs/src/lint/rules");
+ let reference_groups =
+ project_root().join("website/docs/src/_includes/docs/reference/groups.md");
// Clear the rules directory ignoring "not found" errors
if let Err(err) = fs2::remove_dir_all(&root) {
@@ -41,6 +45,7 @@ fn main() -> Result<()> {
// Content of the index page
let mut index = Vec::new();
+ let mut reference_buffer = Vec::new();
writeln!(index, "---")?;
writeln!(index, "title: Lint Rules")?;
writeln!(index, "main-class: rules")?;
@@ -88,11 +93,17 @@ fn main() -> Result<()> {
.remove("nursery")
.expect("Expected nursery group to exist");
+ writeln!(
+ reference_buffer,
+ "<!-- this file is auto generated, use `cargo lintdoc` to update it -->"
+ )?;
for (group, rules) in groups {
generate_group(group, rules, &root, &mut index, &mut errors)?;
+ generate_reference(group, &mut reference_buffer)?;
}
generate_group("nursery", nursery_rules, &root, &mut index, &mut errors)?;
+ generate_reference("nursery", &mut reference_buffer)?;
if !errors.is_empty() {
bail!(
@@ -105,6 +116,7 @@ fn main() -> Result<()> {
}
fs2::write(root.join("index.md"), index)?;
+ fs2::write(reference_groups, reference_buffer)?;
Ok(())
}
@@ -116,55 +128,11 @@ fn generate_group(
mut index: &mut dyn io::Write,
errors: &mut Vec<(&'static str, Error)>,
) -> io::Result<()> {
- let (group_name, description) = match group {
- "a11y" => (
- "Accessibility",
- markup! {
- "Rules focused on preventing accessibility problems."
- },
- ),
- "correctness" => (
- "Correctness",
- markup! {
- "Rules that detect incorrect or useless code."
- },
- ),
-
- "nursery" => (
- "Nursery",
- markup! {
- "New rules that are still under development.
-
-Nursery rules require explicit opt-in via configuration because they may still have bugs or performance problems.
-Nursery rules get promoted to other groups once they become stable or may be removed.
-
-Rules that belong to this group "<Emphasis>"are not subject to semantic version"</Emphasis>"."
- },
- ),
- "style" => (
- "Style",
- markup! {
- "Rules enforcing a consistent way of writing your code. "
- },
- ),
- "complexity" => (
- "Complexity",
- markup! {
- "Rules that focus on inspecting complex code that could be simplified."
- },
- ),
- "security" => (
- "Security",
- markup! {
- "Rules that detect potential security flaws."
- },
- ),
- _ => panic!("Unknown group ID {group:?}"),
- };
+ let (group_name, description) = extract_group_metadata(group);
writeln!(index, "\n## {group_name}")?;
writeln!(index)?;
- markup_to_string(index, description)?;
+ write_markup_to_string(index, description)?;
writeln!(index)?;
writeln!(index, "<div class=\"category-rules\">")?;
@@ -605,8 +573,73 @@ fn assert_lint(
Ok(())
}
-pub fn markup_to_string(buffer: &mut dyn io::Write, markup: Markup) -> io::Result<()> {
+fn generate_reference(group: &'static str, buffer: &mut dyn io::Write) -> io::Result<()> {
+ let (group_name, description) = extract_group_metadata(group);
+ let description = markup_to_string(&description.to_owned());
+ let description = description.replace('\n', " ");
+ writeln!(buffer, "- `{}`: {}", group_name, description)
+}
+
+fn extract_group_metadata(group: &str) -> (&str, Markup) {
+ match group {
+ "a11y" => (
+ "Accessibility",
+ markup! {
+ "Rules focused on preventing accessibility problems."
+ },
+ ),
+ "correctness" => (
+ "Correctness",
+ markup! {
+ "Rules that detect incorrect or useless code."
+ },
+ ),
+
+ "nursery" => (
+ "Nursery",
+ markup! {
+ "New rules that are still under development.
+
+Nursery rules require explicit opt-in via configuration because they may still have bugs or performance problems.
+Nursery rules get promoted to other groups once they become stable or may be removed.
+
+Rules that belong to this group "<Emphasis>"are not subject to semantic version"</Emphasis>"."
+ },
+ ),
+ "style" => (
+ "Style",
+ markup! {
+ "Rules enforcing a consistent way of writing your code. "
+ },
+ ),
+ "complexity" => (
+ "Complexity",
+ markup! {
+ "Rules that focus on inspecting complex code that could be simplified."
+ },
+ ),
+ "security" => (
+ "Security",
+ markup! {
+ "Rules that detect potential security flaws."
+ },
+ ),
+ _ => panic!("Unknown group ID {group:?}"),
+ }
+}
+
+pub fn write_markup_to_string(buffer: &mut dyn io::Write, markup: Markup) -> io::Result<()> {
let mut write = HTML(buffer);
let mut fmt = Formatter::new(&mut write);
fmt.write_markup(markup)
}
+
+fn markup_to_string(markup: &MarkupBuf) -> String {
+ let mut buffer = Vec::new();
+ let mut write = Termcolor(NoColor::new(&mut buffer));
+ let mut fmt = Formatter::new(&mut write);
+ fmt.write_markup(markup! { {markup} })
+ .expect("to have written in the buffer");
+
+ String::from_utf8(buffer).expect("to have convert a buffer into a String")
+}

release: 10.0.0 (#3526)

Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
Co-authored-by: Micha Reiser <micha@rome.tools>
Co-authored-by: Sebastian McKenzie <sebastian@rome.tools>