Skip to content

Commit 1fd8015

Browse files
committed
fix(spec): show error when users load a plugins module called lazy
1 parent 953c279 commit 1fd8015

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/lazy/core/plugin.lua

+3
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ end
158158

159159
---@param spec LazySpecImport
160160
function Spec:import(spec)
161+
if spec.import == "lazy" then
162+
return self:error("You can't name your plugins module `lazy`.")
163+
end
161164
if spec.enabled == false or (type(spec.enabled) == "function" and not spec.enabled()) then
162165
return
163166
end

0 commit comments

Comments
 (0)