The ECMAScript specification defines a set of special words as future keywords of the language. They don’t have particular meaning for now, but
they might at some future time.
The list contains the following words:
-
await
-
class
-
const
-
enum
-
export
-
extends
-
implements
-
import
-
interface
-
let
-
package
-
private
-
protected
-
public
-
static
-
super
-
yield
Some of these words have already been adopted by current versions of ECMAScript, but they are kept to consider legacy JavaScript codebases as well.
Others are only reserved when used in strict mode.
These future reserved words should be avoided because they may cause syntax errors if they are ever adopted.
const package = document.getElementsByName("foo"); // Noncompliant: `package` is used as an identifier here
These future keywords can be used anywhere if it is not identifiers.
const someData = { package: true }; // Compliant: `package` is not used as an identifier here