build(luals): drop src/.luarc.json, test/.luarc.json #40887

Problem:
emmylua reports `unresolved-require` for `require('test.testutil')` and
friends, and a file under `test/` cannot even resolve its own siblings.

This happens because `test/.emmyrc.json` and `test/.luarc.json`, cause
vim.lsp to root the workspace at `test/` instead of the repo top-level.

Solution:
Drop the nested configs:

    src/.luarc.json
    test/.luarc.json
    test/.emmyrc.json

Outcomes:
- No "libraries" needed: luv types come from `runtime/lua/uv/_meta.lua`,
  not `${3rd}/luv` (which would only duplicate them).
- Drop `test/` from the root `.luarc.json` `ignoreDir` so its modules are
  resolvable by LuaLS/Emmylua.
  - Note: this means that LuaLS diagnostics will now be reported for
    `test/`, but that is not a bad thing...
This commit is contained in:
Justin M. Keyes
2026-07-21 08:56:42 -04:00
committed by GitHub
parent f907614088
commit 6d5b774362
4 changed files with 4 additions and 76 deletions
+4 -2
View File
@@ -6,8 +6,10 @@
"workspace": {
"ignoreDir": [
".deps",
"build",
"test"
"build"
],
"ignoreGlobs": [
"test/**/fixtures/**"
],
"preloadFileSize": 1000,
"checkThirdParty": "Disable"
-25
View File
@@ -1,25 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"runtime": {
"version": "LuaJIT"
},
"workspace": {
"library": [
"../runtime/lua",
"${3rd}/luv/library"
],
"preloadFileSize": 1000,
"checkThirdParty": "Disable"
},
"diagnostics": {
"groupFileStatus": {
"strict": "Any",
"strong": "Any"
},
"groupSeverity": {
"strong": "Warning",
"strict": "Warning"
},
"unusedLocalExclude": [ "_*" ]
}
}
-25
View File
@@ -1,25 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json",
"format": {
"externalTool": {
"program": "stylua",
"args": [
"-",
"--stdin-filepath",
"${file}"
]
}
},
"diagnostics": {
"disable": [
"unnecessary-if"
]
},
"codeAction": {
"insertSpace": true
},
"strict": {
"typeCall": true,
"arrayIndex": true
}
}
-24
View File
@@ -1,24 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"runtime": {
"version": "LuaJIT"
},
"workspace": {
"library": [
"../runtime/lua",
"../src"
],
"checkThirdParty": "Disable"
},
"diagnostics": {
"groupFileStatus": {
"strict": "Opened",
"strong": "Opened"
},
"groupSeverity": {
"strong": "Warning",
"strict": "Warning"
},
"unusedLocalExclude": [ "_*" ]
}
}