Skip to Content

What has ES6 to do with Javascript?

Javascript is a browser language and has been developed for round about 20 years now. Javascript had a rough start with all web developers out there – it’s a development language understood by all devices who are capable to browse the internet and yet many browsers implemented Javascript in different ways. This led to many problems for web developers since they had to write workarounds for every browser out there.

With ECMAScript 2015 / ES6 browser manufacturers aim to harmonize the Javascript language and correct some of it’s bad parts and that is the reason why you should use ES6 too if you can.

SAP WebIDE and ES6

SAP Web IDE is the tool of choice to efficiently create SAP Fiori applications, although you will stumble upon some ESLint errors which WebIDE is giving when using the new ES6 features.

To fix this, simply add a “.eslintrc” file to your project root folder, open it and add the following lines:

{
	"env": {
		"es6": true
	}
}

ES6 is now out for more than a year, but of course not all browsers out there support all ES6 features right away – only the most recent versions of Chrome/FireFox/Edge do so. Have a look at this link to get an idea about the compatibility. You can limit the ES6 adoption by turning specific features on/off in ESLint by adopting your code to the following lines:

{
	"env": {
		"es6": true
	},
	"ecmaFeatures": {
            "arrowFunctions": false
        }
		
}

Find a complete list of supported ESLint ecmaFeatures here under “Language options”.

Hope you enjoyed this tutorial and start right away with some nice ES6 language features!

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Timothy Muchena

    Hi

    Just asking the same question that Jizu Sun asked: How do you achieve transpiling in SAPUI5 to make sure that ES6 works in all major browsers?

     

    Kind regards

    (0) 

Leave a Reply