eslint.lua 529 B

123456789101112131415161718192021222324
  1. local null_ls = require("null-ls")
  2. local eslint = require("eslint")
  3. null_ls.setup()
  4. eslint.setup({
  5. bin = 'eslint', -- or `eslint_d`
  6. code_actions = {
  7. enable = true,
  8. apply_on_save = {
  9. enable = true,
  10. types = { "directive", "problem", "suggestion", "layout" },
  11. },
  12. disable_rule_comment = {
  13. enable = true,
  14. location = "separate_line", -- or `same_line`
  15. },
  16. },
  17. diagnostics = {
  18. enable = true,
  19. report_unused_disable_directives = false,
  20. run_on = "type", -- or `save`
  21. },
  22. })