Box-Of-Hats / Bem-VSCode-Extension

A VSCode extension for helping with inserting BEM (Block-Element-Modifier) classes.
BSD 3-Clause "New" or "Revised" License
29 stars 5 forks source link

Add option to change quotes for class names #49

Open spone379 opened 2 years ago

spone379 commented 2 years ago

Hi, this is great extension!)

I have only two limitations when using it.

First - there is no support for React (JS) files. It creates elements with "class" instead of "className".

Secondly - there is no option to change double quotes to single for classNames. (Motivation - different companies have their own style guides)

Box-Of-Hats commented 2 years ago

Hey @spone379, thanks for the feedback!

React support React is officially supported and should work straight out of the box. Are you using .JSX or .TSX files? If so, could you provide some code to help reproduce the issue?

Quote support This should be pretty quick to add. I'll take a look at this soon

spone379 commented 2 years ago

Hey @Box-Of-Hats, thanks for the quick response!

About the React support. We are using.JS files - and it's not supported in these type of files.

Box-Of-Hats commented 2 years ago

@spone379

This is working as intended because you're using a plain JavaScript file. VScode will need to detect your file as a react file in order for it to work like you're expecting.

You can do this in a few ways:

There's a quick 2 minute video here that should solve your problem: https://youtu.be/4wTYV4Zjq5g