-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
refactor(es/transfomer): Prevent breaking change #11308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct Es2015Options {} | ||
|
|
||
| pub fn hook(options: Es2015Options) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct Es2016Options {} | ||
|
|
||
| pub fn hook(options: Es2016Options) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct Es2017Options {} | ||
|
|
||
| pub fn hook(options: Es2017Options) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct Es2018Options {} | ||
|
|
||
| pub fn hook(options: Es2018Options) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct Es2019Options {} | ||
|
|
||
| pub fn hook(options: Es2019Options) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct Es2020Options {} | ||
|
|
||
| pub fn hook(options: Es2020Options) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct Es2021Options {} | ||
|
|
||
| pub fn hook(options: Es2021Options) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct Es2022Options {} | ||
|
|
||
| pub fn hook(options: Es2022Options) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct Es2026Options {} | ||
|
|
||
| pub fn hook(options: Es2026Options) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct JsxOptions {} | ||
|
|
||
| pub fn hook(options: JsxOptions) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ pub use crate::{ | |
| }; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct Options { | ||
| pub typescript: Option<TypescriptOptions>, | ||
| pub decorator: Option<DecoratorOptions>, | ||
|
|
@@ -15,6 +16,7 @@ pub struct Options { | |
| } | ||
|
|
||
|
||
| #[derive(Debug, Default)] | ||
| #[non_exhaustive] | ||
| pub struct EnvOptions { | ||
| pub es2026: Es2026Options, | ||
| pub es2022: Es2022Options, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use swc_ecma_hooks::VisitMutHook; | |
| use crate::TraverseCtx; | ||
|
|
||
| #[derive(Debug, Default)] | ||
|
||
| #[non_exhaustive] | ||
| pub struct TypescriptOptions {} | ||
|
|
||
| pub fn hook(options: TypescriptOptions) -> impl VisitMutHook<TraverseCtx> { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
#[non_exhaustive]attribute should be placed on a separate line from#[derive(Debug, Default)]for better readability and consistency with Rust formatting conventions. It should be: