First of all, thank you very much for this plugin. It has saved us a lot of time.
The cleanRuleRawsBefore function replaces multiple new lines from the before property of a node's raws, but results in a type error same as the title of this issue when the property is missing.
The error is caused by this line: https://github.com/elchininet/postcss-rtlcss/blob/master/src/utilities/rules.ts#L165
The following change fixes the error:
node.raws.before = '\n\n' + (node.raws.before ? node.raws.before.replace(/\n/g, '') : '');
Please let me know if you would like me to create a PR.