create in empty directory with these file:
meta.lua
---@meta
local stub = require("stub")
stub.a = require("stub.a")
a.lua
stub.lua
init.lua
_G.stub = require("stub")
require("a")
.emmyrc.json
stub/a.lua
local M = {}
M.b = {}
return M
goto definition on stub.a in a.lua, it will goto meta.lua, rather than stub/a.lua.