- the argument
--no-colors
has been removed, in favor of--color=off
- The
init
command now adds the$schema
property to the generatedrome.json
file ifrome
is installed inside thenode_modules
folder. Follow this guide to add the$schema
property manually in a project with an existingrome.json
file. - A new
--semicolons
option that configures if the formatter prints semicolons at the end of every statement (default) or at the beginning of statements when necessary to prevent ASI failures. - Rome exits with an error code if it doesn't process any file.
- Fixed how the maximum number of diagnostics is calculated #3869. Rome now prints the total number of errors caused in the files.
- Rome now traverses symbolic links and emits warnings if it detects loops, and continues processing the next file during the directory traversal.
- You can force color output using the new global
--colors
option with the valueforce
. Forcing color output can be useful if you spawn Rome as a subprocess. Rome is spawned as a process;
- Added the JSON schema
$schema
property. The schema enables auto-completion by editors and... auto-completion and descriptions of all fields of the configuration file. - Added a new
files.ignore
option where users can ignore files across tools.
- We also publish Rome to Open VSX.
- The extension now resolves the Rome version installed in the
node_modules
folder. - Fixed an issue where diagnostics were not updated after a change to the configuration file (#3724)[rome#3724]
- The LSP emits a new action where the user can suppress a rule.
- The extension now allows sort imports
- Fixed incompatibility issues with Prettier #3531
- Fixed an issue where infinite parentheses were wrongly inserted #3735
- Better formatting for
jestEach
templates
- Added support for omitting semicolons.
- Fixed false positives emitted by
noUselessFragments
#3668 - Fixed
noArrayIndexKey
where some cases were not detected #3670 - Fixed false positives emitted by
noConstAssign
#3728 - Fixed false positives emitted by
noShoutyConstants
#3867 - Fixed false positives emitted by
noUnusedVariables
#3779 - Fixed
noUndeclaredVariables
where some cases were not detected #3798 - Fixed
noUndeclaredVariables
where types were incorrectly detected #3669
The following rules have been stabilized:
nursery/useFlatMap
->complexity/useFlatMap
nursery/useValidForDirection
->correctness/useValidForDirection
nursery/noExplicitAny
->suspicious/noExplicitAny
nursery/noConstAssign
->correctness/noConstAssign
These rules are all recommended, so they will be enabled by default. You can simply remove those entries from your configuration file if you had enabled them manually from the nursery
group.
The following rules have been renamed:
a11y/useBlankTarget
->a11y/noBlankTarget
correctness/noMultipleSpacesInRegularExpressionLiterals
->complexity/noMultipleSpacesInRegularExpressionLiterals
style/useOptionalChain
->complexity/useOptionalChain
correctness/noUselessFragments
->complexity/noUselessFragments
correctness/noDelete
->performance/noDelete
correctness/useSingleCaseStatement
->style/useSingleCaseStatement
correctness/useWhile
->style/useWhile
correctness/noArguments
->style/noArguments
correctness/noAsyncPromiseExecutor
->suspicious/noAsyncPromiseExecutor
correctness/noCommentText
->suspicious/noCommentText
correctness/noCompareNegZero
->suspicious/noCompareNegZero
correctness/noDebugger
->suspicious/noDebugger
correctness/noDoubleEquals
->suspicious/noDoubleEquals
correctness/noShadowRestrictedNames
->suspicious/noShadowRestrictedNames
correctness/noSparseArray
->suspicious/noSparseArray
correctness/noUnsafeNegation
->suspicious/noUnsafeNegation
correctness/useValidTypeof
->suspicious/useValidTypeof
correctness/noArrayIndexKey
->suspicious/noArrayIndexKey
correctness/noCatchAssign
->suspicious/noCatchAssign
correctness/noDupeArgs
->suspicious/noDuplicateParameters
correctness/noFunctionAssign
->suspicious/noFunctionAssign
correctness/noImportAssign
->suspicious/noImportAssign
correctness/noLabelVar
->suspicious/noLabelVar
correctness/noRestrictedGlobals
->nursery/noRestrictedGlobals
nursery/noDupeKeys
->nursery/noDuplicateObjectKeys
If you were not changing the severity level of any of these rules in your configuration file, or suppressing a diagnostic emitted by those rules using suppression comments, you do not have to do anything. But if you did, Rome will now emit diagnostics for the parts of your configuration or suppression comments you need to update.
The following rules are no longer recommended:
style/noImplicitBoolean
style/noNegationElse
style/useBlockStatements
style/useShorthandArrayType
correctness/useSingleCaseStatement
/style/useSingleCaseStatement
style/noShoutyConstants
The styling decisions imposed by these rules were not deemed to be idiomatic enough in the JavaScript ecosystem to be enabled by default. If you do want to enforce those rules in your project, you will have to enable them manually in you configuration file:
{
"linter": {
"rules": {
"style": {
"useBlockStatements": "warn"
}
}
}
}
Finally, the following new rules have been introduced to the nursery group in this release:
nursery/noAccessKey
nursery/noConditionalAssignment
nursery/noConstEnum
nursery/noConstructorReturn
nursery/noDistractingElements
nursery/noDuplicateObjectKeys
nursery/noEmptyInterface
nursery/noExtraNonNullAssertion
nursery/noHeaderScope
nursery/noNonNullAssertion
nursery/noPrecisionLoss
nursery/noRedundantUseStrict
nursery/noSetterReturn
nursery/noStringCaseMismatch
nursery/noUnsafeFinally
nursery/noVoidTypeReturn
nursery/useDefaultSwitchClauseLast
nursery/useNumericLiterals
nursery/useAriaPropTypes
nursery/useAriaPropsForRole
nursery/noVar
nursery/useConst
Please give them a try by manually enabling them in your configuration and please share your feedback on the rule, diagnostics, and code fixes.
- Added support for
JSON
; - Added support
satisfies
keyword; - Fixed parse for
async
used as label #3612 - Fixed parse of
export default function
ind.ts
files #3485 - Improved the parsing of
await
in non-async contexts #2479
- Removed the "preview" label from the extension.
- Improved logging when the extension can't connect to the server. #3920
- The concept of
backend
has been removed, in favor of the concept ofdistribution
. - Removed the possibility to connect to the daemon, for the time being.
- The APIs are asynchronous anymore.
- The package has been marked as unstable and in alpha state.
- Respect the formatter / linter
enabled
flag from configuration (#3591) - Correctly account for diff diagnostics in the printed diagnostics count (#3595)
- Do not insert a trailing comma in import expressions (#3600)
- Fixed false positives in
noUselessFragments
,noArrayIndexKey
,noChildrenProp
,noUselessFragments
,noVoidElementsWithChildren
,noDangerouslySetInnerHtml
,noDangerouslySetInnerHtmlWithChildren
,useValidAnchor
,noRenderReturnValue
,noUnusedVariables
anduseKeyWithClickEvents
(#3592, #3619, #3599, #3626, #3620 & #3644)
- Display the version of the language server in the status bar (#3616)
- 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 forrome 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 commandrome ci
. - Added a new argument
--linter-enabled
to the commandrome 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. - Fixed the command
rome ci
command to run the linter even if the formatter is disabled, closes #3495. - Fixed the messaging of some diagnostics, #3460.
- Added
files.maxSize
, to change the allowed size of files, in bytes.
- Fix false positive for unknown lint rule in suppression comments during formatting #3406.
- Correctly handle empty lines when printing code diffs #3375.
- Added the new trailing comma option that configures where to add trailing commas. Supports the values:
all
,es5
andnone
; refer to the documentation to learn more. - Improved JSX formatting #3499, #3211, #3377
- Better formatting of object destructing
- Improved formatting of test calls
- Fixed formatting of trailing comments in arrow functions
- 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 to learn more about the affected rules.
- Fixed issues in the
noUnreachable
rule - Fixed false positive cases for
noNegationElse
#3141 - Fixed false positive cases for
noUnusedVariables
#3169 - Fixed an issue in our CFG #3390
noAutoFocus
useAltText
noBlankTarget
useAnchorContent
useKeyWithClickEvents
useKeyWithMouseEvents
noPositiveTabIndex
useValidAnchor
noRestrictedGlobals
useSimplifiedBooleanExpression
noInvalidConstructorSuper
useValidForDirection
noConstAssign
noExplicitAny
noBannedTypes
useMapFlat
useExhaustiveDependencies
- Improved messaging of diagnostics, using our new infrastructure
- Fixed an issue where diagnostics couldn't be printed in WASM #3349
- Allow arguments in d.ts files #3388
- Fix parsing of less than in optional call chains #3486
- Fixed a case where
export {"a"} from "b";
wasn't correctly parsed
- 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
- Fixed a poor diagnostic that was emitted when navigating a symbolic symbol #3329
- Added a size limit when inspecting files #3330
- Do not print tabs and spaces for unchanged lines #3327
- Fixed the calculation of text diffs inside the LSP #3350
- Rome is now faster and uses less memory on macOS and Linux systems! #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
You can now ignore folders and files using the Unix shell style patterns:
{
"formatter": {
"ignore": ["scripts/*.js"]
},
"linter": {
"ignore": ["src/**.test.{ts,js}"]
}
}
- Completely revamped how the formatter handles comments and their placement inside the code #3277
- Improved formatting of intersection and unions types #3162
- Improved formatting of member chains #3283
- Improved formatting of call arguments #3290
- 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 to know better about the new groups.
The new groups are heavily inspired from
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 - Improved the rule
useCamelCase
#3190 #3210 - Fixed invalid code action for
useOptionalChain
#3257 - Fixed bugs in
noUnusedVariables
#3170, #3316
useButtonType
noRenderReturnValue
noDangerouslySetInnerHtml
useOptionalChain
useFragmentSyntax
noUselessFragments
noChildrenProp
noArrayIndexKey
noVoidElementsWithChildren
noUndeclaredVariables
noDangerouslySetInnerHtmlWithChildren
- Fixed an issue where the parser was not emitting a diagnostic on a certain TypeScript syntax #3115
- 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 therules
section
- Fixes an issue where arguments were not correctly picked up and applied to the formatter #3175
- Fixes a regression where the arguments passed via CLI were ignored #3175
- Fixes a regression where the command
rome ci
was not correctly reading the configuration #3167
- Windows: fixes an issue where the extension could not load the configuration file #3182
- You can now format content from standard input when using the command
rome format
:
echo "function f() { return {} }" | rome format --stdin-file-path example.js
the argument --stdin-file-path
is mandatory when formatting from standard in. The path should represent a
file name with its extension.
- Added
--apply-suggested
argument to therome check
command, to apply suggested and safe fixes. Suggested fixes should be considered unstable and applied with care. - Added the
rome start
androme stop
commands to control the Rome daemon server process. - Added the
--use-server
global flag to the command line to make the CLI connect to a running instance of the Rome daemon server.
- BREAKING CHANGE: removed the second
"rules"
field from a field group.
{
"linter": {
"enabled": true,
"rules": {
"js": {
+ "noDebugger": "off"
- "rules": {
- "noDebugger": "off"
- },
}
}
}
}
- fixed a problem that was incorrectly turning off rules in certain circumstances
Significantly improved formatting and prettier compatibility of:
- JSX #3144
- Conditional expression and conditional types #2427
- Function signatures #2993, #2990
- Return and throw statements #2986
- Logical and binary expressions #3079
- Templates #3063
- Arrow expression chains #3122
- Member expression assignments #3061
- Array expressions #3126
- Parenthesized expressions and types, including inserting parentheses to improve readability #3057, #3083, #3108
- Doc comments #3129
- Changed the default severity for recommended rules to "error". You can change the severity in the rome.json.
- Added
js/noExtraBooleanCast
lint rule. - Added
js/noDupeArgs
lint rule. - Added
js/noShadowRestrictedNames
lint rule. - Added
js/inlineVariable
code action. - Applied various stability fixes to the rule
js/noUnusedVariables
. #3124 #3060 #3004 - Fixed how the suggestion is applied
js/noNegationElse
. #2999 - Fixed a false positive in the rule
js/noShoutyConstants
. #3077 - Fixed a false positive in the rule
ts/useShorthandArrayType
. #3111
- Added
--max-diagnostics
argument to the commandrome check
. - The maximum number of diagnostics printed is now 20, use
--max-diagnostics
to change the default. - Added a new command
rome init
.
- You can create a configuration file called
rome.json
to customize Rome's default options. This will work from both CLI and LSP.
-
You can now use the configuration file
rome.json
to change Rome's defaults:Example:
{ "root": true, "formatter": { "indentStyle": "space" } }
-
Fixed some edge cases where the comment suppressions were not working as expected.
The linter is now marked as "alpha" and it can be used to lint code from the CLI and from the LSP.
- BREAKING CHANGE: Removed the majority of settings that were available in the extension, use the
configuration file
rome.json
to change the Rome's defaults. - The extension now allows to rename variables;
- Added
--no-colors
argument.
- JSX and TSX are now formatted by default! Make sure to enable Rome as default formatter in the VSCode extension.
- Improved the consistency of formatting of various statements:
- call arguments;
- object property members;
- variable declarations;
- object patterns;
- class property members;
- Fixed a bunch of issues in the TypeScript formatting.
- Added the new
--apply
argument to therome check
command; - New rules added to the linter, check the website;
Fixes a regression introduced in the rome format
command (#2670)
- BREAKING CHANGES: the command
rome format --ci
has been removed, userome ci
instead.
Improved the compatibility with Prettier (check #2403 for more details)
- TypeScript's formatting is better in line with what Prettier does.
- Better formatting of string literals.
Removing unnecessary quotes in string literals and quotes from member names.
Correctly choose the correct quote based on quantity of quotes inside a literal:
// original code let a = { "something": 3 } let b = "cool isn\'t it"; let c = "\"content\" ' "; // formatted code let a = { something: 3 } let b = "cool isn't it"; let c = '"content" \' ';
- Better formatting of various statements
- Improved the performance of the formatter an average of 20%-30%! Check the relevant PRs 1, 2, 3, 4, 5 if you're interested in what the team did.
To reach better compatibility with Prettier, the team had to revise the foundation of our printer, which caused some regressions around how comments are printed. These are known issues that we plan to close by next release.
We've built the foundation of our linter. At the moment is only opt-in, and it contains only a bunch of rules. Safe fixes are not enabled yet via CLI.
Refer to the website to learn how to start using it.
-
BREAKING CHANGES: the
format
command doesn't write on disk by default. Now the command prints on terminal.Migration: add the
--write
argument when callingrome format
rome format --write
-
Added a new option called
--quote-style
to the formatter. This option is also available on VSCode.
Rome has been rewritten in Rust!
The great majority of the previous functionality won't work anymore, as we rewrote the whole software from scratch.
Rome, for now, exposes a new formatter that has been revisited and, is way faster compared to its former version!
To install it, use the next
tag on npm
:
npm i rome@next
Or follow our getting started section for more details.