Currently the regex can't add comma to JavaScript objects which has more than 2 variables
For example :
{
hello: 'world',
foo: 'bar'
};
This will turn into :
{
hello: 'world',
foo: 'bar'; // Notice the line break? 🤔
};
Now the python regex that i am using is :
NEW_LINE_REPLACE_PATTERN: Pattern = re.compile(
r"(?!^)(?<![\s{,\"\`;])\n(?!^(\s\S*($|[\"\`)$]|)}))(?![\w\s]*[\)])"
)
Currently the regex can't add comma to JavaScript objects which has more than 2 variables
For example :
This will turn into :
Now the python regex that i am using is :