#[repr(u8)]pub enum ScriptTarget {
Show 14 variants
ES3 = 0,
ES5 = 1,
ES2015 = 2,
ES2016 = 3,
ES2017 = 4,
ES2018 = 5,
ES2019 = 6,
ES2020 = 7,
ES2021 = 8,
ES2022 = 9,
ES2023 = 10,
ES2024 = 11,
ES2025 = 12,
ESNext = 99,
}Expand description
ECMAScript target version.
This determines which language features are available during compilation.
Variants§
ES3 = 0
ECMAScript 3 (1999)
ES5 = 1
ECMAScript 5 (2009)
ES2015 = 2
ECMAScript 2015 (6th Edition)
ES2016 = 3
ECMAScript 2016 (7th Edition)
ES2017 = 4
ECMAScript 2017 (8th Edition)
ES2018 = 5
ECMAScript 2018 (9th Edition)
ES2019 = 6
ECMAScript 2019 (10th Edition)
ES2020 = 7
ECMAScript 2020 (11th Edition)
ES2021 = 8
ECMAScript 2021 (12th Edition)
ES2022 = 9
ECMAScript 2022 (13th Edition)
ES2023 = 10
ECMAScript 2023 (14th Edition)
ES2024 = 11
ECMAScript 2024 (15th Edition)
ES2025 = 12
ECMAScript 2025 (16th Edition) — TS6 default (LatestStandard)
ESNext = 99
Latest ECMAScript features
Implementations§
Source§impl ScriptTarget
impl ScriptTarget
Sourcepub const fn supports_es2016(self) -> bool
pub const fn supports_es2016(self) -> bool
Check if this target supports ES2016+ features (exponentiation operator).
Sourcepub const fn supports_es2015(self) -> bool
pub const fn supports_es2015(self) -> bool
Check if this target supports ES2015+ features (classes, arrows, etc.)
Sourcepub const fn supports_es2017(self) -> bool
pub const fn supports_es2017(self) -> bool
Check if this target supports ES2017+ features (async, etc.)
Sourcepub const fn supports_es2020(self) -> bool
pub const fn supports_es2020(self) -> bool
Check if this target supports ES2020+ features (optional chaining, etc.)
Sourcepub const fn supports_es2018(self) -> bool
pub const fn supports_es2018(self) -> bool
Check if this target supports ES2018+ features (async generators, dotAll regex, etc.)
Sourcepub const fn supports_es2019(self) -> bool
pub const fn supports_es2019(self) -> bool
Check if this target supports ES2019+ features (optional catch binding).
Sourcepub const fn supports_es2021(self) -> bool
pub const fn supports_es2021(self) -> bool
Check if this target supports ES2021+ features (logical assignment).
Sourcepub const fn supports_es2022(self) -> bool
pub const fn supports_es2022(self) -> bool
Check if this target supports ES2022+ features (class fields, regex ‘d’ flag, etc.)
Sourcepub const fn supports_es2023(self) -> bool
pub const fn supports_es2023(self) -> bool
Check if this target supports ES2023+ features.
Sourcepub const fn supports_es2024(self) -> bool
pub const fn supports_es2024(self) -> bool
Check if this target supports ES2024+ features.
Sourcepub const fn supports_es2025(self) -> bool
pub const fn supports_es2025(self) -> bool
Check if this target supports ES2025+ features.
Trait Implementations§
Source§impl Clone for ScriptTarget
impl Clone for ScriptTarget
Source§fn clone(&self) -> ScriptTarget
fn clone(&self) -> ScriptTarget
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScriptTarget
impl Debug for ScriptTarget
Source§impl Default for ScriptTarget
impl Default for ScriptTarget
Source§fn default() -> ScriptTarget
fn default() -> ScriptTarget
Source§impl PartialEq for ScriptTarget
impl PartialEq for ScriptTarget
impl Copy for ScriptTarget
impl Eq for ScriptTarget
impl StructuralPartialEq for ScriptTarget
Auto Trait Implementations§
impl Freeze for ScriptTarget
impl RefUnwindSafe for ScriptTarget
impl Send for ScriptTarget
impl Sync for ScriptTarget
impl Unpin for ScriptTarget
impl UnsafeUnpin for ScriptTarget
impl UnwindSafe for ScriptTarget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.