How to use plugins.null-ls.extraOptions to add sources? #460
-
DescriptionCurrently, this option doesn't have an example to show usage. I'm lost on how to use this option to add sources that are not yet in nixvim. According to the description, it should be an attribute set. Looking at Here's a snippet of what ends up in init.lua using the config below: require("null-ls").setup({["sources"] = {"require(\"null-ls\").builtins.formatting.eslint_d","require(\"null-ls\").builtins.formatting.prettier_d","require(\"null-ls\").builtins.code_actions.eslint_d","require(\"null-ls\").builtins.diagnostics.eslint_d"}}) Configplugins.null-ls = {
enable = true;
extraOptions = {
sources = [
''require("null-ls").builtins.formatting.eslint_d''
''require("null-ls").builtins.formatting.prettier_d''
''require("null-ls").builtins.code_actions.eslint_d''
''require("null-ls").builtins.diagnostics.eslint_d''
];
};
}; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Got an answer from the Matrix channel. you can use the Here's what that looks like: { pkgs, helpers, ... }:
{
plugins.null-ls = {
enable = true;
extraOptions = {
sources = helpers.mkRaw ''
{ require("null-ls").builtins.formatting.eslint_d,
require("null-ls").builtins.formatting.prettier_d_slim,
require("null-ls").builtins.code_actions.eslint_d,
require("null-ls").builtins.diagnostics.eslint_d
}
'';
};
};
} |
Beta Was this translation helpful? Give feedback.
Got an answer from the Matrix channel. you can use the
mkRaw
helper function to insert raw Lua code.Here's what that looks like: