Skip to content

Commit 39b9c5d

Browse files
committed
feat(linter)!: remove unmaintained security plugin (#7773)
1 parent 9157a0e commit 39b9c5d

38 files changed

Lines changed: 19 additions & 1000 deletions

apps/oxlint/src/command/lint.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,6 @@ pub struct EnablePlugins {
283283
/// Enable the node plugin and detect node usage problems
284284
#[bpaf(flag(OverrideToggle::Enable, OverrideToggle::NotSet), hide_usage)]
285285
pub node_plugin: OverrideToggle,
286-
287-
/// Enable the security plugin and detect security problems
288-
#[bpaf(flag(OverrideToggle::Enable, OverrideToggle::NotSet), hide_usage)]
289-
pub security_plugin: OverrideToggle,
290286
}
291287

292288
/// Enables or disables a boolean option, or leaves it unset.
@@ -362,7 +358,6 @@ impl EnablePlugins {
362358
self.react_perf_plugin.inspect(|yes| plugins.set(LintPlugins::REACT_PERF, yes));
363359
self.promise_plugin.inspect(|yes| plugins.set(LintPlugins::PROMISE, yes));
364360
self.node_plugin.inspect(|yes| plugins.set(LintPlugins::NODE, yes));
365-
self.security_plugin.inspect(|yes| plugins.set(LintPlugins::SECURITY, yes));
366361

367362
// Without this, jest plugins adapted to vitest will not be enabled.
368363
if self.vitest_plugin.is_enabled() && self.jest_plugin.is_not_set() {

crates/oxc_linter/src/config/oxlintrc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ mod test {
171171
serde_json::from_str(r#"{ "plugins": ["typescript", "unicorn"] }"#).unwrap();
172172
assert_eq!(config.plugins, LintPlugins::TYPESCRIPT.union(LintPlugins::UNICORN));
173173
let config: Oxlintrc =
174-
serde_json::from_str(r#"{ "plugins": ["typescript", "unicorn", "react", "oxc", "import", "jsdoc", "jest", "vitest", "jsx-a11y", "nextjs", "react-perf", "promise", "node", "security"] }"#).unwrap();
174+
serde_json::from_str(r#"{ "plugins": ["typescript", "unicorn", "react", "oxc", "import", "jsdoc", "jest", "vitest", "jsx-a11y", "nextjs", "react-perf", "promise", "node"] }"#).unwrap();
175175
assert_eq!(config.plugins, LintPlugins::all());
176176

177177
let config: Oxlintrc =

crates/oxc_linter/src/config/plugins.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ bitflags! {
3838
const PROMISE = 1 << 11;
3939
/// `eslint-plugin-node`
4040
const NODE = 1 << 12;
41-
/// Custom security rules made by the Oxc team
42-
const SECURITY = 1 << 13;
4341
}
4442
}
4543
impl Default for LintPlugins {
@@ -65,7 +63,6 @@ impl From<LintPluginOptions> for LintPlugins {
6563
plugins.set(LintPlugins::REACT_PERF, options.react_perf);
6664
plugins.set(LintPlugins::PROMISE, options.promise);
6765
plugins.set(LintPlugins::NODE, options.node);
68-
plugins.set(LintPlugins::SECURITY, options.security);
6966
plugins
7067
}
7168
}
@@ -115,7 +112,6 @@ impl From<&str> for LintPlugins {
115112
"react-perf" | "react_perf" => LintPlugins::REACT_PERF,
116113
"promise" => LintPlugins::PROMISE,
117114
"node" => LintPlugins::NODE,
118-
"security" | "oxc-security" => LintPlugins::SECURITY,
119115
// "eslint" is not really a plugin, so it's 'empty'. This has the added benefit of
120116
// making it the default value.
121117
_ => LintPlugins::empty(),
@@ -139,7 +135,6 @@ impl From<LintPlugins> for &'static str {
139135
LintPlugins::REACT_PERF => "react-perf",
140136
LintPlugins::PROMISE => "promise",
141137
LintPlugins::NODE => "node",
142-
LintPlugins::SECURITY => "security",
143138
_ => "",
144139
}
145140
}
@@ -245,7 +240,6 @@ pub struct LintPluginOptions {
245240
pub react_perf: bool,
246241
pub promise: bool,
247242
pub node: bool,
248-
pub security: bool,
249243
}
250244

251245
impl Default for LintPluginOptions {
@@ -264,7 +258,6 @@ impl Default for LintPluginOptions {
264258
react_perf: false,
265259
promise: false,
266260
node: false,
267-
security: false,
268261
}
269262
}
270263
}
@@ -287,7 +280,6 @@ impl LintPluginOptions {
287280
react_perf: false,
288281
promise: false,
289282
node: false,
290-
security: false,
291283
}
292284
}
293285

@@ -308,7 +300,6 @@ impl LintPluginOptions {
308300
react_perf: true,
309301
promise: true,
310302
node: true,
311-
security: true,
312303
}
313304
}
314305
}
@@ -332,7 +323,6 @@ impl<S: AsRef<str>> FromIterator<(S, bool)> for LintPluginOptions {
332323
LintPlugins::REACT_PERF => options.react_perf = enabled,
333324
LintPlugins::PROMISE => options.promise = enabled,
334325
LintPlugins::NODE => options.node = enabled,
335-
LintPlugins::SECURITY => options.security = enabled,
336326
_ => {} // ignored
337327
}
338328
}
@@ -365,7 +355,6 @@ mod test {
365355
&& self.react_perf == other.react_perf
366356
&& self.promise == other.promise
367357
&& self.node == other.node
368-
&& self.security == other.security
369358
}
370359
}
371360

@@ -405,7 +394,6 @@ mod test {
405394
react_perf: false,
406395
promise: false,
407396
node: false,
408-
security: false,
409397
};
410398
assert_eq!(plugins, expected);
411399
}

crates/oxc_linter/src/context/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,5 +350,4 @@ const PLUGIN_PREFIXES: phf::Map<&'static str, &'static str> = phf::phf_map! {
350350
"unicorn" => "eslint-plugin-unicorn",
351351
"vitest" => "eslint-plugin-vitest",
352352
"node" => "eslint-plugin-node",
353-
"security" => "oxc-security",
354353
};

crates/oxc_linter/src/rules.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,6 @@ mod oxc {
443443
pub mod uninvoked_array_callback;
444444
}
445445

446-
mod security {
447-
pub mod api_keys;
448-
}
449-
450446
mod nextjs {
451447
pub mod google_font_display;
452448
pub mod google_font_preconnect;
@@ -850,7 +846,6 @@ oxc_macros::declare_all_lint_rules! {
850846
react_perf::jsx_no_new_array_as_prop,
851847
react_perf::jsx_no_new_function_as_prop,
852848
react_perf::jsx_no_new_object_as_prop,
853-
security::api_keys,
854849
typescript::adjacent_overload_signatures,
855850
typescript::array_type,
856851
typescript::ban_ts_comment,

crates/oxc_linter/src/rules/security/api_keys/entropy.rs

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)