vscode-react-javascript-snippets icon indicating copy to clipboard operation
vscode-react-javascript-snippets copied to clipboard

En dash on file name causes invalid syntax

Open marcosmarp opened this issue 3 years ago • 0 comments
trafficstars

When using a snippet that uses the current file name, and that file name have a - on it, it causes invalid syntax.

Example with tsrafce

import React from 'react'

type Props = {}

const delete-modal= (props: Props) => {
  return (
    <div>delete-modal</div>
  )
}

export default delete-modal

A - on a function name isn't valid so something like this would be nice:

import React from 'react'

type Props = {}

const DeleteModal = (props: Props) => {
  return (
    <div>delete-modal</div>
  )
}

export default DeleteModal;

Thanks!

marcosmarp avatar May 04 '22 00:05 marcosmarp