The upstream rules added a new object beside the already supported string | { name: string, message: string } option.
See the implementation here: eslint/eslint#19939
Our current oxlint rules does not support this new option:
|
fn from_configuration(value: serde_json::Value) -> Result<Self, serde_json::error::Error> { |
|
let list = match value { |
|
Value::Array(arr) => arr.iter().fold(FxHashMap::default(), |mut acc, v| match v { |
|
// "no-restricted-globals": ["error", "event"] |
|
Value::String(name) => { |
|
acc.insert(name.clone(), String::new()); |
|
acc |
|
} |
|
// "no-restricted-globals": ["error", { "name": "event", "message": "Use local parameter instead." }] |
|
Value::Object(obj) => { |
|
let name = obj.get("name").and_then(Value::as_str).unwrap_or_default(); |
|
let message = obj.get("message").and_then(Value::as_str).unwrap_or_default(); |
|
acc.insert(name.to_string(), message.to_string()); |
|
acc |
|
} |
|
_ => acc, |
|
}), |
|
_ => FxHashMap::default(), |
|
}; |
|
|
|
Ok(Self { restricted_globals: Box::new(list) }) |
|
} |
The upstream rules added a new object beside the already supported
string | { name: string, message: string }option.See the implementation here: eslint/eslint#19939
Our current oxlint rules does not support this new option:
oxc/crates/oxc_linter/src/rules/eslint/no_restricted_globals.rs
Lines 70 to 91 in 57612b3