Sometimes I'd like to know if the code I'm writing is ES5 compliant/safe or not.
Example: this would fail because of the arrow function.
() => "something";
I know Babel
could take care of this. But sometimes I would like to test some cases.
Is there a place where I could do this?
Try ESlint, https://eslint.org/demo. You can disable advanced rules and stick to the basics.
For example, with an arrow function on ES5: https://eslint.org/demo#eyJ0ZXh0IjoiKCkgPT4gXCJzb21ldGhpbmdcIjsiLCJvcHRpb25zIjp7InBhcnNlck9wdGlvbnMiOnsiZWNtYVZlcnNpb24iOjUsInNvdXJjZVR5cGUiOiJzY3JpcHQiLCJlY21hRmVhdHVyZXMiOnt9fSwicnVsZXMiOnt9LCJlbnYiOnt9fX0=
It could also be automated as part of a build/ci script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With