-
The CLI now exists with an error then there's an error inside the configuration.
Previously, rome would raise warnings and continue the execution, by applying its defaults.
This wasn't ideal for users, because this could have created false positives in linting, or formatted code with a configuration that wasn't the of the user.
-
The command
rome checknow shows formatter diagnostics when checking the code.The presence of the diagnostics will result in an error code when the command finishes.
This is in line with semantic and behaviour meant for the command
rome check.
-
Fix #4670, don't crash at empty default export.
-
Fix #4556, which correctly handles new lines in the
.gitignorefile across OS. -
Add a new option to ignore unknown files
--files-ignore-unknown:rome format ./src --files-ignore-unknown
Doing so, Rome won't emit diagnostics for files that doesn't know how to handle.
-
Add a new option
--no-errors-on-unmatched:rome format ./src --no-errors-on-unmatched
Rome won't exit with an error code in case no files were processed in the given paths.
-
Fixed the diagnostics emitted when running the
rome formatcommand; -
Rome doesn't warn anymore when discovering (possibly infinite) symbolic links between directories. This fixes #4193 which resulted in incorrect warnings when a single file or directory was pointed at by multiple symbolic links. Symbolic links to other symbolic links do still trigger warnings if they are too deeply nested.
-
Add a new option to ignore unknown files:
{ "files": { "ignoreUnknown": true } }Doing so, Rome won't emit diagnostics for file that it doesn't know how to handle.
-
Add a new
"javascript"option to support the unsafe/experimental parameter decorators:{ "javascript": { "parser": { "unsafeParameterDecoratorsEnabled": true } } } -
Add a new
"extends"option, useful to split the configuration file in multiple files:{ "extends": ["../sharedFormatter.json", "linter.json"] }The resolution of the files is file system based, Rome doesn't know how to resolve dependencies yet.
-
The commands
rome checkandrome lintnow show the remaining diagnostics even when--apply-safeor--apply-unsafeare passed. -
Fix the commands
rome checkandrome lint, they won't exit with an error code if no error diagnostics are emitted. -
Add a new option
--error-on-warnings, which instructs Rome to exit with an error code when warnings are emitted.rome check --error-on-wanrings ./src
-
Add a configuration to enable parsing comments inside JSON files:
{ "json": { "parser": { "allowComments": true } } }
- The Rome LSP is now able to show diagnostics that belong to JSON lint rules.
- Fix #4564, now files too large don't emit errors.
- The Rome LSP now sends client messages when files are ignored or too big.
-
Add a new option called
--jsx-quote-styleto the formatter. This option allows you to choose between single and double quotes for JSX attributes. #4486 -
Add a new option called
--arrow-parenthesesto the formatter. This option allows you to set the parentheses style for arrow functions. #4666 -
The JSON formatter is now able to format
.jsonfiles that have comments.
noDuplicateParameters: enhanced rule to manage constructor parameters.
-
Remove
complexity/noExtraSemicolon(#4553)The Rome formatter takes care of removing extra semicolons. Thus, there is no need for this rule.
-
Remove
useCamelCaseUse
useNamingConventioninstead.
-
Add
noGlobalIsFiniteThis rule recommends using
Number.isFiniteinstead of the global and unsafeisFinitethat attempts a type coercion. -
Add
noGlobalIsNanThis rule recommends using
Number.isNaNinstead of the global and unsafeisNaNthat attempts a type coercion. -
Add
noUnsafeDeclarationMergingThis rule disallows declaration merging between an interface and a class.
-
Add
useArrowFunctionThis rule proposes turning function expressions into arrow functions. Function expressions that use
thisare ignored. -
This rule disallow duplicate keys in a JSON object.
-
Add
noVoidThis rules disallow the use of
void. -
This rule disallows
\8and\9escape sequences in string literals. -
This rule disallows useless
export {}. -
Add
useIsArrayThis rule proposes using
Array.isArray()instead ofinstanceof Array.
New rules are promoted, please check #4750 for more details:
a11y/useHeadingContentcomplexity/noForEachcomplexity/useLiteralKeyscomplexity/useSimpleNumberKeyscorrectness/useIsNansuspicious/noConsoleLogsuspicious/noDuplicateJsxProps
The following rules are now recommended:
-
Add new TypeScript globals (
AsyncDisposable,Awaited,DecoratorContext, and others) 4643. -
noRedeclare: allow redeclare of index signatures are in different type members #4478 -
Improve
noConsoleLog,noGlobalObjectCalls,useIsNan, anduseNumericLiteralsby handlingglobalThisandwindownamespaces.For instance, the following code is now reported by
noConsoleLog:globalThis.console.log("log")
-
Fix a crash in the
NoParameterAssignrule that occurred when there was a bogus binding. #4323 -
Fix
useExhaustiveDependenciesrule in the following cases #4330- when the first argument of hooks is a named function
- inside an export default function
- for React.use* hooks
-
Fix
noInvalidConstructorSuperrule that erroneously reported generic parents #4624. -
Fix
noDuplicateCaserule that erroneously reported as equals the strings literals"'"and'"'#4706. -
Improve
noInnerDeclarationsNow, the rule doesn't report false-positives about ambient TypeScript declarations. For example, the following code is no longer reported by the rule:
declare var foo;
-
Improve
useEnumInitializersThe rule now reports all uninitialized members of an enum in a single diagnostic.
Moreover, ambient enum declarations are now ignored. This avoids reporting ambient enum declarations in TypeScript declaration files.
declare enum Weather { Rainy, Sunny, }
-
Relax
noBannedTypesand improve documentationThe rule no longer reports a user type that reuses a banned type name. The following code is now allowed:
import { Number } from "a-lib"; declare const v: Number;
The rule now allows the use of the type
{}to denote a non-nullable generic type:function f<T extends {}>(x: T) { assert(x != null); }
And in a type intersection for narrowing a type to its non-nullable equivalent type:
type NonNullableMyType = MyType & {};
-
Improve the diagnostic and the code action of
useDefaultParameterLast.The diagnostic now reports the last required parameter which should precede optional and default parameters.
The code action now removes any whitespace between the parameter name and its initialization.
-
Relax noConfusingArrow
All arrow functions that enclose its parameter with parenthesis are allowed. Thus, the following snippet no longer trigger the rule:
var x = (a) => 1 ? 2 : 3;
The following snippet still triggers the rule:
var x = a => 1 ? 2 : 3;
-
Relax
useLiteralEnumMembersEnum members that refers to previous enum members are now allowed. This allows common pattern in enum flags like in the following example:
enum FileAccess { None = 0, Read = 1, Write = 1 << 1, All = Read | Write, }
Arbitrary numeric constant expressions are also allowed:
enum FileAccess { None = 0, Read = 2**0, Write = 2**1, All = Read | Write, }
-
Improve useLiteralKeys.
Now, the rule suggests simplifying computed properties to string literal properties:
{ - ["1+1"]: 2, + "1+1": 2, }It also suggests simplifying string literal properties to static properties:
{ - "a": 0, + a: 0, }These suggestions are made in object literals, classes, interfaces, and object types.
-
Improve
noNewSymbol.The rule now handles cases where
Symbolis namespaced with the globalglobalThisorwindow. -
The rules
useExhaustiveDependenciesanduseHookAtTopLevelaccept a different shape of optionsOld configuration
{ "linter": { "rules": { "nursery": { "useExhaustiveDependencies": { "level": "error", "options": { "hooks": [ ["useMyEffect", 0, 1] ] } } } } } }New configuration
{ "linter": { "rules": { "nursery": { "useExhaustiveDependencies": { "level": "error", "options": { "hooks": [ { "name": "useMyEffect", "closureIndex": 0, "dependenciesIndex": 1 } ] } } } } } } -
noRedundantUseStrict check only
'use strict'directive to resolve false positive diagnostics.React introduce new directives, "use client" and "use server". The rule raises false positive errors about these directives.
-
Fix false positive diagnostics (#4483) that
NoUnreachableSupercaused to nested if statement.The rule no longer reports
This constructor calls super() in a loopwhen using nested if statements in a constructor. -
Fix useHookAtTopLevel 's false positive diagnostics (#4637)
The rule no longer reports false positive diagnostics when accessing properties directly from a hook and calling a hook inside function arguments.
-
Fix noUselessFragments's panics when running
rome check --apply-unsafe(#4637)This rule's code action emits an invalid AST, so I fixed using JsxString instead of JsStringLiteral
-
Fix noUndeclaredVariables's false positive diagnostics (#4675)
The semantic analyzer no longer handles
thisreference identifier. -
Fix noUnusedVariables's false positive diagnostics (#4688)
The semantic analyzer handles ts export declaration clause correctly.
-
Add support for decorators in class method parameters, example:
class AppController { get(@Param() id) {} // ^^^^^^^^ new supported syntax }
This syntax is only supported via configuration, because it's a non-standard syntax.
{ "//": "rome.json file", "javascript": { "parser": { "unsafeParameterDecoratorsEnabled": true } } } -
Add for parsing comments inside JSON files:
{ "json": { "parser": { "allowComments": true } } }
rome lsp-proxyshould accept the global CLI options #4505- Enhance help descriptions
- Accept the environment variable 'ROME_BINARY' to override the Rome binary
- Fix an issue where all the
nurserywere enabled when the"nursery": {}object was defined #4479
- Fix false positive diagnostics (#4483) that
useHookAtTopLevelcaused to returning call expressions of a hook. - Revert #4359
- Revert #4359
- Fix regression where a specific combination of configuration didn't load the correct rules to apply #4502
noInnerDeclarations: allow function declarations in nested block inside an ES module #4492.noInvalidConstructorSuper: recognizeextendsclauses that use static member access such asextends mod.C#4499
- Fix regression where the command
lsp-proxywas renamedlsp_proxy#4489
- Fix an issue where the
noAssignInExpressionsrule replaced the operator with an invalid token, which caused other lint rules to crash. #4464 - Fix an issue that
noUnusedVariablesrule did not correctly detect exports when a variable and aninterfacehad the same name #4468
- Refactored the underling argument parsing logic. Changed the look and feel of the help output. #4405.
- The command
rome checkcan accept input fromstdin. - Add the argument
--stdin-file-pathto use when runningrome checkviastdin. - Add the argument
--formatter-enabledto the commandrome checkto control the formatter via CLI. - Add the argument
--linter-enabledto the commandrome checkto control the linter via CLI. - Add the argument
--organize-imports-enabledto the commandrome checkto control the import sorting via CLI. - Add new command
rome migratethe transform the configuration filerome.jsonwhen there are breaking changes.
- Add
vcsproperty, to opt in the VCS integration:vcs.enabled, to enable or not the integration;vcs.clientKind, the supported clients;vcs.useIgnoreFile, to ignore the files/paths inside the file;vcs.root, an optional path to the root of the VCS;
- Fix an issue where the VSCode extension duplicates text when using VSCode git utilities #4338
- Remove code assists from being added to the code actions when apply fixes;
- When requesting code actions, ignored files should not throw errors. Fixes #4434
- Fix an issue where formatting of JSX string literals property values were using incorrect quotes #4054
- Changed import assertion grammar to the new import attribute assertion
- import "module" assert {}
+ import "module" with {}- Fix an issue where JSON formatter does not respect
lineWidthfor arrays #4351 - Add support for decorators
noConfusingArrownoRedundantRolesnoNoninteractiveTabindexnoAriaUnsupportedElementsnoConsoleLognoForEachuseLiteralKeysnoConstantConditionuseGroupedTypeImportnoUselessConstructoruseLiteralEnumMembersuseHeadingContentnoAccumulatingSpreaduseSimpleNumberKeys
New rules are promoted, please check #4431 for more details.
- lint/a11y/noNoninteractiveElementToInteractiveRole
- lint/a11y/noRedundantAlt
- lint/a11y/noSvgWithoutTitle
- lint/a11y/useAriaPropsForRole
- lint/a11y/useIframeTitle
- lint/a11y/useMediaCaption
- lint/a11y/useValidAriaProps
- lint/a11y/useValidLang
- lint/complexity/noExtraSemicolon
- lint/complexity/noUselessCatch
- lint/complexity/noUselessConstructor
- lint/complexity/noUselessLabel
- lint/complexity/noUselessRename
- lint/complexity/noUselessSwitchCase
- lint/complexity/noWith
- lint/correctness/noGlobalObjectCalls
- lint/correctness/noInnerDeclarations
- lint/correctness/noInvalidConstructorSuper
- lint/correctness/noSwitchDeclarations
- lint/correctness/noUnreachableSuper
- lint/correctness/noUnsafeOptionalChaining
- lint/correctness/noUnusedLabels
- lint/correctness/useYield
- lint/style/noCommaOperator
- lint/style/noInferrableTypes
- lint/style/noNamespace
- lint/style/noParameterAssign
- lint/style/noParameterProperties
- lint/style/noRestrictedGlobals
- lint/suspicious/noAssignInExpressions
- lint/suspicious/noClassAssign
- lint/suspicious/noConfusingLabels
- lint/suspicious/noDuplicateCase
- lint/suspicious/noDuplicateClassMembers
- lint/suspicious/noPrototypeBuiltins
- lint/suspicious/noRedeclare
- lint/suspicious/noSelfCompare
- lint/suspicious/useNamespaceKeyword
Note that, noExtraSemicolons and noExtraLabels are renamed to noExtraSemicolon and noUselessLabel.
- Code actions are formatted using Rome's formatter. If the formatter is disabled, the code action is not formatted.
- Fixed an issue that
useShorthandArrayTyperule did not handle nested ReadonlyArray types correctly and erroneously reported TsObjectType #4354. noUndeclaredVariablesdetects globals based on the file type.- Fix an issue when
noUndeclaredVariablesincorrectly identifiesAggregateErroras an undeclared variable. #4365 - Fix an issue that
useLiteralKeysrule doesn't ignore valid uses of square bracket notation. #4370 - Fix #4348 that caused
noNonNullAssertionto emit incorrect code action - Fix #4410 that caused
useButtonTypeto miss some cases - Fix false positive diagnostics that
useCamelCasecaused to default exported components - Fix false positive diagnostics that
useCamelCasecaused to private class members - Fix false positive diagnostics that
useHookAtTopLevelcaused to arrow functions, export default functions and function expressions. - Fix false positive diagnostics that
useHookAtTopLevelcaused toasorsatisfiesexpression. - Fix false positive diagnostics that
noHeadeScopecaused to custom components - Fix false negative diagnostics that
noNoninteractiveElementToInteractiveRoleandnoNoninteractiveTabindexcaused to non-interactive elements.
- Allow module syntax in
ctsfiles - Changed import assertion grammar to the new import attribute assertion
- import "module" assert {}
+ import "module" with {}- Allow decorators before
exportandexport default. #4252 - Add support for Stage 3 decorators
requireConfigurationis set totrueby default
- Review how the traversal of the file system works. Now Rome won't navigate folders that are ignored.
While this change is a bug fix, this could affect how the
ignoreentries are defined inside a project. We suggest to review them and make sure they still work. --apply-suggestedis now called--apply-unsaferome check --applyandrome check --apply-unsafeexits with non-zero code (error code) if there are still diagnostics to be addressed.
rome checknow checks import statements. This is an experimental feature that needs to be enabled via configuration. Import can be sorted usingrome check --apply-unsafe- Rome is able to auto discover the configuration file. If Rome doesn't fine a configuration in the working directory, it will try to find one in the parent directories.
- Add a new global options called
--config-path. It tells Rome to try and discover arome.jsonfile in the given path.rome format --config-path=../../other/path/ rome check --config-path=../../other/path/
- Rome now uses the internal JSON parser to validate the configuration file. This means Rome won't
exit anymore if there are issues with the
rome.jsonfile, instead it will apply its defaults to the sections that are incorrect. - Add
javascript.organizeImports. This is an experimental feature and users need to opt-in.
{
"organizeImports": {
"enabled": true,
"ignore": ["trickyFile.js"]
}
}- Add
linter.rules.allandlinter.rules.[group].all. These options allow to enable or disable all rules, or all rules for a given group.allandrecommendedcan't be bothtrue.
{
"linter": {
"rules": {
"all": true,
"style" : {
"all": false
}
}
}
}The previous example will enable all rules and disable all rules that belong to the style group.
- Add support to display diagnostics for JSON files.
- Add support to format JSON files.
- Pull diagnostics when parsing a
rome.jsonfile. - Imports sorting is not applied for files that are not supported or ignored.
- Add support for JSON files
- Add support for TypeScript 4.7
- Add support for TypeScript 5.0
New rules are promoted, please check #4239 for more details.
- lint/correctness/noUnsafeFinally
- lint/correctness/noConstructorReturn
- lint/correctness/noPrecisionLoss
- lint/correctness/noVoidTypeReturn
- lint/correctness/noStringCaseMismatch
- lint/correctness/noSetterReturn
- lint/a11y/useHtmlLang
- lint/a11y/noDistractingElements
- lint/a11y/noHeaderScope
- lint/a11y/noAccessKey
- lint/style/useExponentiationOperator
- lint/style/useNumericLiterals
- lint/style/useDefaultParameterLast
- lint/style/useConst
- lint/style/noVar
- lint/style/noNonNullAssertion
- lint/style/useEnumInitializers
- lint/suspicious/noEmptyInterface
- lint/suspicious/noExtraNonNullAssertion
- lint/suspicious/noRedundantUseStrict
- lint/suspicious/noConstEnum
- lint/suspicious/useDefaultSwitchClauseLast
- lint/suspicious/noDuplicateObjectKeys
- Support for TypeScript 4.7
- Support for TypeScript 5.0
- Add a new option called
requireConfiguration. Enabling this option will force Rome to require a configuration file in your workspace/project. If Rome doesn't find arome.jsonfile, it won't emit diagnostics.
- the argument
--no-colorshas been removed, in favor of--color=off
- The
initcommand now adds the$schemaproperty to the generatedrome.jsonfile ifromeis installed inside thenode_modulesfolder. Follow this guide to add the$schemaproperty manually in a project with an existingrome.jsonfile. - A new
--semicolonsoption 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
--colorsoption 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
$schemaproperty. The schema enables auto-completion by editors and... auto-completion and descriptions of all fields of the configuration file. - Added a new
files.ignoreoption 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_modulesfolder. - Fixed an issue where diagnostics were not updated after a change to the configuration file (#3724)[#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
jestEachtemplates
- Added support for omitting semicolons.
- Fixed false positives emitted by
noUselessFragments#3668 - Fixed
noArrayIndexKeywhere 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
noUndeclaredVariableswhere some cases were not detected #3798 - Fixed
noUndeclaredVariableswhere types were incorrectly detected #3669
The following rules have been stabilized:
nursery/useFlatMap->complexity/useFlatMapnursery/useValidForDirection->correctness/useValidForDirectionnursery/noExplicitAny->suspicious/noExplicitAnynursery/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/noBlankTargetcorrectness/noMultipleSpacesInRegularExpressionLiterals->complexity/noMultipleSpacesInRegularExpressionLiteralsstyle/useOptionalChain->complexity/useOptionalChaincorrectness/noUselessFragments->complexity/noUselessFragmentscorrectness/noDelete->performance/noDeletecorrectness/useSingleCaseStatement->style/useSingleCaseStatementcorrectness/useWhile->style/useWhilecorrectness/noArguments->style/noArgumentscorrectness/noAsyncPromiseExecutor->suspicious/noAsyncPromiseExecutorcorrectness/noCommentText->suspicious/noCommentTextcorrectness/noCompareNegZero->suspicious/noCompareNegZerocorrectness/noDebugger->suspicious/noDebuggercorrectness/noDoubleEquals->suspicious/noDoubleEqualscorrectness/noShadowRestrictedNames->suspicious/noShadowRestrictedNamescorrectness/noSparseArray->suspicious/noSparseArraycorrectness/noUnsafeNegation->suspicious/noUnsafeNegationcorrectness/useValidTypeof->suspicious/useValidTypeofcorrectness/noArrayIndexKey->suspicious/noArrayIndexKeycorrectness/noCatchAssign->suspicious/noCatchAssigncorrectness/noDupeArgs->suspicious/noDuplicateParameterscorrectness/noFunctionAssign->suspicious/noFunctionAssigncorrectness/noImportAssign->suspicious/noImportAssigncorrectness/noLabelVar->suspicious/noLabelVarcorrectness/noRestrictedGlobals->nursery/noRestrictedGlobalsnursery/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/noImplicitBooleanstyle/noNegationElsestyle/useBlockStatementsstyle/useShorthandArrayTypecorrectness/useSingleCaseStatement/style/useSingleCaseStatementstyle/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/noAccessKeynursery/noConditionalAssignmentnursery/noConstEnumnursery/noConstructorReturnnursery/noDistractingElementsnursery/noDuplicateObjectKeysnursery/noEmptyInterfacenursery/noExtraNonNullAssertionnursery/noHeaderScopenursery/noNonNullAssertionnursery/noPrecisionLossnursery/noRedundantUseStrictnursery/noSetterReturnnursery/noStringCaseMismatchnursery/noUnsafeFinallynursery/noVoidTypeReturnnursery/useDefaultSwitchClauseLastnursery/useNumericLiteralsnursery/useAriaPropTypesnursery/useAriaPropsForRolenursery/noVarnursery/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
satisfieskeyword; - Fixed parse for
asyncused as label #3612 - Fixed parse of
export default functionind.tsfiles #3485 - Improved the parsing of
awaitin 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
backendhas 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
enabledflag 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,noUnusedVariablesanduseKeyWithClickEvents(#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
--versionas an alias forrome version - Added a new argument
--files-max-sizeto change the allowed size of files, in bytes. - Added a new argument
--formatter-enabledto the commandrome ci. - Added a new argument
--linter-enabledto the commandrome ci. - Added the new
formatoption--trailing-commato configure where to add trailing commas. - Correctly show the supported options for
rome ci, closes #3456. - Fixed the command
rome cicommand 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,es5andnone; 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
noUnreachablerule - Fixed false positive cases for
noNegationElse#3141 - Fixed false positive cases for
noUnusedVariables#3169 - Fixed an issue in our CFG #3390
noAutoFocususeAltTextnoBlankTargetuseAnchorContentuseKeyWithClickEventsuseKeyWithMouseEventsnoPositiveTabIndexuseValidAnchornoRestrictedGlobalsuseSimplifiedBooleanExpressionnoInvalidConstructorSuperuseValidForDirectionnoConstAssignnoExplicitAnynoBannedTypesuseMapFlatuseExhaustiveDependencies
- 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.jsonand 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
useButtonTypenoRenderReturnValuenoDangerouslySetInnerHtmluseOptionalChainuseFragmentSyntaxnoUselessFragmentsnoChildrenPropnoArrayIndexKeynoVoidElementsWithChildrennoUndeclaredVariablesnoDangerouslySetInnerHtmlWithChildren
- Fixed an issue where the parser was not emitting a diagnostic on a certain TypeScript syntax #3115
- The setting
lspBincan be also expressed as relative path - The rules have been added to the configuration schema, allowing users to receive autocomplete
when editing the
rome.jsonfor therulessection
- 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 ciwas 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.jsthe argument --stdin-file-path is mandatory when formatting from standard in. The path should represent a
file name with its extension.
- Added
--apply-suggestedargument to therome checkcommand, to apply suggested and safe fixes. Suggested fixes should be considered unstable and applied with care. - Added the
rome startandrome stopcommands to control the Rome daemon server process. - Added the
--use-serverglobal 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/noExtraBooleanCastlint rule. - Added
js/noDupeArgslint rule. - Added
js/noShadowRestrictedNameslint rule. - Added
js/inlineVariablecode 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-diagnosticsargument to the commandrome check. - The maximum number of diagnostics printed is now 20, use
--max-diagnosticsto change the default. - Added a new command
rome init.
- You can create a configuration file called
rome.jsonto customize Rome's default options. This will work from both CLI and LSP.
-
You can now use the configuration file
rome.jsonto 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.jsonto change the Rome's defaults. - The extension now allows to rename variables;
- Added
--no-colorsargument.
- 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
--applyargument to therome checkcommand; - 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 --cihas been removed, userome ciinstead.
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
formatcommand doesn't write on disk by default. Now the command prints on terminal.Migration: add the
--writeargument when callingrome formatrome format --write
-
Added a new option called
--quote-styleto 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@nextOr follow our getting started section for more details.