b3nj5m1n/kommentary

Custom comment in react jsx

phuongthuan opened this issue · 0 comments

kommentary support jsx comment by default but I still want to custom my comment like below:

// Single line
{/* <p>Single line comment</p> */}

// Multiple lines
{/* This is 
    for multi-line comments. */}

Here is my config:

-----------------------------------------------------------
-- Comment for vim
-----------------------------------------------------------

local kommentary_config = require('kommentary.config')

-- Plugin: kommentary
--- https://github.com/b3nj5m1n/kommentary

local M = {}

function M.setup()
  kommentary_config.configure_language('default', {
    single_line_comment_string  = 'auto',
    prefer_single_line_comments = true,
    multi_line_comment_strings  = false,
  })
  kommentary_config.configure_language('typescriptreact', {
    single_line_comment_string  = '{/*", "*/}',
    multi_line_comment_strings = {"{/*", "*/}"},
    prefer_single_line_comments = true,
  })
  kommentary_config.configure_language('javascriptreact', {
    single_line_comment_string  = '{/*", "*/}',
    multi_line_comment_strings = {"{/*", "*/}"},
    prefer_single_line_comments = true,
  })
end

return M

Is anything wrong with my config? It did not work as I expected.