`quoteStyle` is ignored for `noUnusedTemplateLiteral` suggestion
Author: garymathewsCreated May 9, 2023Updated Jul 31, 2023
LabelsenhancementA-LSP
Environment information
CLI:
Version: 12.0.0
Color support: true
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
ROME_LOG_DIR: unset
NO_COLOR: unset
TERM: "xterm-256color"
JS_RUNTIME_VERSION: "v19.8.1"
JS_RUNTIME_NAME: "node"
NODE_PACKAGE_MANAGER: "yarn/1.22.19"
Rome Configuration:
Status: Loaded successfully
Formatter disabled: false
Linter disabled: false
Organize imports disabled: true
Workspace:
Open Documents: 0What happened?
- Specifying
singlequote style and performing a lint check which returns anoUnusedTemplateLiteralwarning suggests double-quotes due to: https://github.com/rome/tools/blob/main/crates/rome_js_factory/src/make.rs#L22 which is hard-coded to double quotes. It should really use the specified quote style.
"javascript": {
"formatter": {
"quoteStyle": "single"
}
}✖ Do not use template literals if interpolation and special-character handling are not needed.
328 │ // Something bad happened, throw exception.
> 329 │ throw new ServerError(`Could not update module.`);
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^
330 │ }
331 │
ℹ Suggested fix: Replace with string literal
329 │ → → throw·new·ServerError("Could·not·update·module.");Expected result
noUnusedTemplateLiteral suggestion should use the specified quoteStyle
Code of Conduct
- I agree to follow Rome's Code of Conduct
Source: rome/tools