mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
[BE] Even more permissive ref annotation comment
Allow `readOnly` and `writable` or even `WriTaBlE`. commit-id:f6f77fd8
This commit is contained in:
1 parent
a574d15985
commit
b605fc1ab3
1 file changed
+2
-2
@@ -22,7 +22,7 @@ export default {
|
||||
};
|
||||
|
||||
const ANNOTATIONS_IMMUT = ["immut", "readonly"];
|
||||
const ANNOTATIONS_MUT = ["mut", "mutable"];
|
||||
const ANNOTATIONS_MUT = ["mut", "mutable", "writable"];
|
||||
|
||||
/**
|
||||
* Eventually, we probably want to move RefKind refinements
|
||||
@@ -195,7 +195,7 @@ function refineUses(
|
||||
function hasLeadingComment(path: NodePath, annotation: string): boolean {
|
||||
return (
|
||||
path.node.leadingComments?.some(
|
||||
(comment) => comment.value.trim() === annotation
|
||||
(comment) => comment.value.trim().toLowerCase() === annotation
|
||||
) ?? false
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user