Skip to content

Commit 41d507f

Browse files
authored
refactor(es/lints): Remove warnings without features (#10794)
**Description:** The warnings have been annoying for a long time.
1 parent 316b4c3 commit 41d507f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.changeset/healthy-ads-bathe.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
swc_core: patch
3+
swc_ecma_lints: patch
4+
---
5+
6+
refactor(lint): Remove warnings without features

crates/swc_ecma_lints/src/rules/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@ pub struct LintParams<'a> {
6060
pub source_map: Arc<SourceMap>,
6161
}
6262

63-
pub fn all(lint_params: LintParams) -> Vec<Box<dyn Rule>> {
64-
let mut rules = vec![critical_rules::critical_rules()];
63+
pub fn all(#[allow(unused)] lint_params: LintParams) -> Vec<Box<dyn Rule>> {
64+
let rules = vec![critical_rules::critical_rules()];
6565

6666
#[cfg(feature = "non_critical_lints")]
67-
{
67+
let rules = {
68+
let mut rules = rules;
69+
6870
let LintParams {
6971
program,
7072
lint_config,
@@ -203,7 +205,9 @@ pub fn all(lint_params: LintParams) -> Vec<Box<dyn Rule>> {
203205
unresolved_ctxt,
204206
es_version,
205207
));
206-
}
208+
209+
rules
210+
};
207211

208212
rules
209213
}

0 commit comments

Comments
 (0)