fix(linter): not use new_inline with flexible str (#2106)

This commit is contained in:
Wenzhe Wang 2024-01-21 16:37:27 +08:00 committed by GitHub
parent 4adce6fb45
commit 142f84f654
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,7 +102,7 @@ impl Rule for NoNamedAsDefaultMember {
return;
};
if let Some(module_name) =
get_external_module_name_if_has_entry(ident, &Atom::new_inline(prop_str))
get_external_module_name_if_has_entry(ident, &Atom::from(prop_str))
{
ctx.diagnostic(NoNamedAsDefaultMemberDignostic(
match member_expr {
@ -165,6 +165,11 @@ fn test() {
const baz = {};
const a = baz.a;
}",
r"import baz from './named-exports';
{
const baz = {};
const a = baz.looooooooooooooooooooooooong;
}",
];
let fail = vec![