CLI:
Version: 1.8.3
Color support: true
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
BIOME_LOG_DIR: unset
NO_COLOR: unset
TERM: "xterm-256color"
JS_RUNTIME_VERSION: "v21.4.0"
JS_RUNTIME_NAME: "node"
NODE_PACKAGE_MANAGER: unset
Biome Configuration:
Status: Loaded successfully
Formatter disabled: false
Linter disabled: false
Organize imports disabled: false
VCS disabled: false
Workspace:
Open Documents: 0
I'm using neovim. The first TypeScript file that I open is treated correctly as a TypeScript file, but every other TypeScript file after that is analyzed as if it were a JavaScript file, and it throws syntax warnings about the types.
Here are the server logs for one of the incorrect lints:
βββbiome_lsp::handlers::analysis::code_actions{uri=file:///Users/lynn/Code/Graveflex/nextjs-vercel/apps/web/src/app/(app)/%5blocale%5d/page.tsx, range=Range { start: Position { line: 38, character: 57 }, end: Position { line: 38, character: 57 } }, only=No
ne, diagnostics=[]}
ββ 0ms DEBUG biome_service::workspace::server File capabilities: Js(JsFileSource { language: JavaScript, variant: Jsx, module
_kind: Module, version: ES2022, embedding_kind: None }) BiomePath { path: "/Users/lynn/Code/Graveflex/nextjs-vercel/apps/web/src
/app/(app)/[locale]/page.tsx" }
ββ 0ms DEBUG biome_service::workspace The file has the following feature sets:
β {Search: FileNotSupported, OrganizeImports: Supported, Lint: Supported, Format: Supported}
ββ 0ms DEBUG biome_lsp::handlers::analysis Cursor range 1190..1190
ββ 0ms DEBUG biome_service::workspace::server File capabilities: Js(JsFileSource { language: JavaScript, variant: Jsx, module
_kind: Module, version: ES2022, embedding_kind: None }) BiomePath { path: "/Users/lynn/Code/Graveflex/nextjs-vercel/apps/web/src
/app/(app)/[locale]/page.tsx" }
βββbiome_service::file_handlers::javascript::code_actions{}
βββbiome_service::file_handlers::javascript::Code actions JavaScript{range=1190..1190, path=BiomePath { path: "/Users/lynn/C
ode/Graveflex/nextjs-vercel/apps/web/src/app/(app)/[locale]/page.tsx" }}
βββ
βββ
ββ 1ms DEBUG biome_lsp::handlers::analysis Pull actions result: PullActionsResult { actions: [] }
ββ 1ms DEBUG biome_lsp::handlers::analysis Suggested actions:
β []
βββ
You can see in the filename that it's a .tsx
file, but for whatever reason it's assuming language: JavaScript
instead of language: TypeScript
.
Here is the relevant part of my neovim config:
return {
'VonHeikemen/lsp-zero.nvim',
branch = 'v4.x',
lazy = false,
dependencies = {
'williamboman/mason.nvim',
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
"jose-elias-alvarez/nvim-lsp-ts-utils",
'hrsh7th/cmp-nvim-lsp',
-- "WhoIsSethDaniel/mason-tool-installer.nvim",
},
config = function()
local lsp_zero = require('lsp-zero')
local mason_lspconfig = require("mason-lspconfig")
local lsp_attach = function(client, bufnr)
local opts = {buffer = bufnr}
end
local lsp_servers = {
'lua_ls',
'rust_analyzer',
'ts_ls',
'biome',
'eslint',
'slint_lsp',
'cssls',
'dockerls',
'dotls',
'graphql',
'html',
'yamlls',
'solargraph',
'phpactor'
}
lsp_zero.extend_lspconfig({
sign_text = true,
lsp_attach = lsp_attach,
capabilities = require('cmp_nvim_lsp').default_capabilities(),
})
lsp_zero.setup_servers(lsp_servers)
require('mason').setup({})
require('mason-lspconfig').setup({
ensure_installed = lsp_servers,
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({})
end,
}
})
end,
keys = {
-- format keymaps
{ '<leader>f', vim.lsp.buf.format, desc = 'LspFormat' },
-- lsp keymaps
{ "gD", vim.lsp.buf.type_definition, desc = 'LspGotoDef' },
{ "gi", vim.lsp.buf.implementation, desc = 'LspGotoImp' }
}
}
I don't have this same problem with the eslint
LSP (or any other LSP).
It should always lint TypeScript files using TypeScript rules, not JavaScript rules.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too