biome-vscode
biome-vscode copied to clipboard
π `suspicious/noRedundantUseStrict` is reported for `.cjs` files
VS Code version
1.94.0-insider
Extension version
2.3.0
Biome version
1.9.2
Operating system
- [ ] Windows
- [ ] macOS
- [X] Linux
Description
The extension reports an error for use strict
directive in .cjs
files with suspicious/noRedundantUseStrict
.
Steps to reproduce
- Create a file with
.cjs
exntension. - Add
use strict
directive. - Error is shown as a problem.
Expected behavior
No errors are shown as documents says.
Instead, .cjs files are considered βscriptsβ and the directive "use strict" is accepted and advised.
Does this issue occur when using the CLI directly?
No
Link to a minimal reproduction
https://github.com/risu729/biome-repro-1727086476220
Logs
CLI:
Version: 1.9.2
Color support: true
Platform:
CPU Architecture: x86_64
OS: linux
Environment:
BIOME_LOG_PATH: unset
BIOME_LOG_PREFIX_NAME: unset
BIOME_CONFIG_PATH: unset
NO_COLOR: unset
TERM: "xterm-256color"
JS_RUNTIME_VERSION: "v22.9.0"
JS_RUNTIME_NAME: "node"
NODE_PACKAGE_MANAGER: "npm/10.8.3"
Biome Configuration:
Status: Loaded successfully
Formatter disabled: false
Linter disabled: false
Organize imports disabled: false
VCS disabled: true
Workspace:
Open Documents: 0
Discovering running Biome servers...
Running Biome Server: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
i The client isn't connected to any server but rage discovered this running Biome server.
Server:
Version: 1.9.2
Name: biome_lsp
CPU Architecture: x86_64
OS: linux
Workspace:
Open Documents: 0
Other Active Server Workspaces:
Workspace:
Open Documents: 2
Client Name: Visual Studio Code - Insiders
Client Version: 1.94.0-insider
Biome Server Log:
! Please review the content of the log file before sharing it publicly as it may contain sensitive information:
* Path names that may reveal your name, a project name, or the name of your employer.
* Source code
βbiome_cli::commands::daemon::Running Server{pid=9130}
ββ INFO biome_cli::service::unix Trying to connect to socket /home/risu/.cache/biome/biome-socket-1.9.2
ββ INFO biome_lsp::server Starting Biome Language Server...
ββ WARN biome_lsp::server The Biome Server was initialized with the deprecated `root_path` parameter: this is not supported, use `root_uri` instead
ββ INFO biome_lsp::server Attempting to load the configuration from 'biome.json' file
ββ INFO biome_lsp::session Detected workspace folder.
ββ INFO biome_lsp::session Attempt to load the configuration file in Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/home/risu/github/use-strict-biome/biome-repro-1727086476220", query: None, fragment: None }
βββbiome_fs::fs::os::OsFileSystem::open_with_options{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/biome.json", options=OpenOptions { read: true, write: false, truncate: false, create: false, create_new: false }}
βββ
βββbiome_fs::fs::os::OsFile::read_to_string{}
βββ
βββbiome_json_parser::parse{}
βββ
ββ INFO biome_lsp::session Configuration loaded successfully from disk.
ββ INFO biome_lsp::session Update workspace settings.
ββ DEBUG biome_service::workspace::server Compare the current project with the new one None Some("/home/risu/github/use-strict-biome/biome-repro-1727086476220") true
βββbiome_fs::fs::os::OsFileSystem::open_with_options{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/package.json", options=OpenOptions { read: true, write: false, truncate: false, create: false, create_new: false }}
βββ
βββbiome_fs::fs::os::OsFile::read_to_string{}
βββ
βββbiome_json_parser::parse{}
βββ
βββbiome_lsp::handlers::text_document::did_open{text_document_uri=file:///home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs, text_document_language_id=javascript}
βββbiome_service::file_handlers::try_from_language_id{language_id="javascript"}
βββ
βββbiome_service::file_handlers::try_from_path{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββbiome_service::file_handlers::try_from_well_known{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββ
βββbiome_service::file_handlers::try_from_extension{extension="cjs"}
βββ
βββ
βββbiome_service::file_handlers::try_from_path{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββbiome_service::file_handlers::try_from_well_known{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββ
βββbiome_service::file_handlers::try_from_extension{extension="cjs"}
βββ
βββ
ββ DEBUG biome_service::workspace::server File capabilities: Js(JsFileSource { language: JavaScript, variant: Jsx, module_kind: Module, version: ES2022, embedding_kind: None }) BiomePath { path: "/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs", kind: FileKinds(BitFlags<FileKind>(0b10000, Handleable)), was_written: false }
βββbiome_service::file_handlers::try_from_path{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββbiome_service::file_handlers::try_from_well_known{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββ
βββbiome_service::file_handlers::try_from_extension{extension="cjs"}
βββ
βββ
βββbiome_service::file_handlers::try_from_path{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββbiome_service::file_handlers::try_from_well_known{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββ
βββbiome_service::file_handlers::try_from_extension{extension="cjs"}
βββ
βββ
ββ DEBUG biome_service::workspace The file has the following feature sets:
β {Format: Supported, Search: Supported, Assists: Supported, Lint: Supported, OrganizeImports: Supported}
βββbiome_service::file_handlers::try_from_path{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββbiome_service::file_handlers::try_from_well_known{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββ
βββbiome_service::file_handlers::try_from_extension{extension="cjs"}
βββ
βββ
ββ DEBUG biome_service::workspace::server File capabilities: Js(JsFileSource { language: JavaScript, variant: Jsx, module_kind: Module, version: ES2022, embedding_kind: None }) BiomePath { path: "/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs", kind: FileKinds(BitFlags<FileKind>(0b10000, Handleable)), was_written: false }
βββbiome_service::file_handlers::try_from_path{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββbiome_service::file_handlers::try_from_well_known{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββ
βββbiome_service::file_handlers::try_from_extension{extension="cjs"}
βββ
βββ
βββbiome_js_parser::parse::parse{}
βββ
βββbiome_service::file_handlers::try_from_path{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββbiome_service::file_handlers::try_from_well_known{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββ
βββbiome_service::file_handlers::try_from_extension{extension="cjs"}
βββ
βββ
ββ DEBUG biome_service::workspace::server File capabilities: Js(JsFileSource { language: JavaScript, variant: Jsx, module_kind: Module, version: ES2022, embedding_kind: None }) BiomePath { path: "/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs", kind: FileKinds(BitFlags<FileKind>(0b10000, Handleable)), was_written: false }
βββbiome_service::file_handlers::try_from_path{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββbiome_service::file_handlers::try_from_well_known{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββ
βββbiome_service::file_handlers::try_from_extension{extension="cjs"}
βββ
βββ
βββbiome_service::workspace::server::Pulling diagnostics{categories=RuleCategories(BitFlags<Categories>(0b111, Syntax | Lint | Action))}
βββbiome_service::file_handlers::try_from_path{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββbiome_service::file_handlers::try_from_well_known{path="/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs"}
βββ
βββbiome_service::file_handlers::try_from_extension{extension="cjs"}
βββ
βββ
βββbiome_service::file_handlers::javascript::Linting JavaScript file{path=BiomePath { path: "/home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs", kind: FileKinds(BitFlags<FileKind>(0b10000, Handleable)), was_written: false }, language=Js(JsFileSource { language: JavaScript, variant: Jsx, module_kind: Module, version: ES2022, embedding_kind: None })}
ββ INFO biome_service::file_handlers::javascript Analyze file /home/risu/github/use-strict-biome/biome-repro-1727086476220/index.cjs
ββ DEBUG biome_rowan::ast::batch pushing change...
ββ DEBUG biome_rowan::ast::batch pushing change...
βββ
βββ
ββ INFO biome_service::workspace::server Pulled 1 diagnostic(s)
βββ
ββ INFO biome_lsp::session Loaded client configuration: Object {
β "enabled": Bool(true),
β "lspBin": String(""),
β "searchInPath": Bool(true),
β "rename": Bool(false),
β }
ββ INFO biome_lsp::session Unregister capabilities "workspace/didChangeConfiguration, textDocument/rangeFormatting, textDocument/onTypeFormatting, textDocument/rename, textDocument/formatting, workspace/didChangeWatchedFiles"
ββ INFO biome_lsp::session Register capabilities "workspace/didChangeConfiguration, textDocument/rangeFormatting, textDocument/onTypeFormatting, textDocument/formatting, workspace/didChangeWatchedFiles"