From 762959c72d08994c2ad7c4f43405e591cc6af6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 13 Feb 2024 16:03:57 +0900 Subject: [PATCH] feat(swc_core): Expose ES linter (#8635) --- Cargo.lock | 1 + crates/swc_core/Cargo.toml | 4 ++++ crates/swc_core/src/lib.rs | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index e5f2edd7623f..c09c846a2c61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3928,6 +3928,7 @@ dependencies = [ "swc_css_visit", "swc_ecma_ast", "swc_ecma_codegen", + "swc_ecma_lints", "swc_ecma_loader", "swc_ecma_minifier", "swc_ecma_parser", diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 8875f0462c0f..67afccb9c8db 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -97,6 +97,8 @@ ecma_quote = [ # Enable swc_ecma_utils ecma_utils = ["__utils", "__common"] +ecma_lints = ["__ecma_lints", "__common"] + # Enable swc_ecma_transforms base features ecma_transforms = ["__ecma_transforms"] ecma_transforms_compat = ["__ecma_transforms", "swc_ecma_transforms_compat"] @@ -312,6 +314,7 @@ __cached = ["swc_cached"] __common = ["swc_common"] __css = [] __ecma = ["swc_ecma_transforms_base"] +__ecma_lints = ["swc_ecma_lints"] __ecma_loader = ["__ecma", "swc_ecma_loader"] __ecma_transforms = ["__ecma"] __parser = ["__ecma", "swc_ecma_parser"] @@ -341,6 +344,7 @@ swc_css_utils = { optional = true, version = "0.137.18", path swc_css_visit = { optional = true, version = "0.139.18", path = "../swc_css_visit" } swc_ecma_ast = { optional = true, version = "0.112.2", path = "../swc_ecma_ast" } swc_ecma_codegen = { optional = true, version = "0.148.3", path = "../swc_ecma_codegen" } +swc_ecma_lints = { optional = true, version = "0.92.4", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "0.45.19", path = "../swc_ecma_loader" } swc_ecma_minifier = { optional = true, version = "0.192.4", path = "../swc_ecma_minifier" } swc_ecma_parser = { optional = true, version = "0.143.3", path = "../swc_ecma_parser" } diff --git a/crates/swc_core/src/lib.rs b/crates/swc_core/src/lib.rs index 2637d9eabda8..14ded2a01e8b 100644 --- a/crates/swc_core/src/lib.rs +++ b/crates/swc_core/src/lib.rs @@ -135,6 +135,13 @@ pub mod ecma { pub use swc_ecma_usage_analyzer::*; } + // visit* interfaces + #[cfg(feature = "ecma_lints")] + #[cfg_attr(docsrs, doc(cfg(feature = "ecma_lints")))] + pub mod lints { + pub use swc_ecma_lints::*; + } + // visit* interfaces #[cfg(feature = "__visit")] #[cfg_attr(docsrs, doc(cfg(feature = "__visit")))]