Screen Too Small

This course material requires a larger screen to properly display the terminal and editor interfaces.

Please use a tablet, laptop, or desktop computer for the best learning experience.

You can continue browsing, but the experience will be significantly limited.

17/25
Free Trial: 3 lessons remaining
Unlock Full Access

Tools for JS and Python

Estimated time: 5 minutes

Once again, extending the capabilities of none-ls is really easy now that we have our basic configuration done. In order to extend these capabilities to Javascript, or Python projects.

We simply need to get the right tool, for JS its eslint or prettier. and for Python, there are a tons of tools for linting/formatting, black is one example. Then you install these tools with Mason, and add them to our configuration. So now our configuration could look like this:

return {
"nvimtools/none-ls.nvim",
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.black,
null_ls.builtins.diagnostics.erb_lint,
null_ls.builtins.diagnostics.rubocop,
null_ls.builtins.formatting.rubocop,
},
})

vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})

end,
}

You've completed this lesson!

You completed this lesson less than a minute ago.