packages/eslint-plugin-fb-flow/rules/use-indexed-access-type.js
/**
 * Sometimes we need to put parens around the object type so we produce
 * a valid fix.
 */
Sometimes we need to put parens around the object type so we produce
a valid fix.
Sometimes we need to put parens around the object type so we produce a valid fix .
function doesObjectNeedsParens(node) {
  switch (node.type) {
    case 'IntersectionTypeAnnotation':
    case 'UnionTypeAnnotation':
    case 'NullableTypeAnnotation':
    case 'FunctionTypeAnnotation':
    case 'TypeofTypeAnnotation':
    case 'OptionalIndexedAccessType':
      return true;
    default:
      return false;
  }
}
function doesObjectNeedsParens ( node ) { switch ( node . type ) { case 'IntersectionTypeAnnotation' : case 'UnionTypeAnnotation' : case 'NullableTypeAnnotation' : case 'FunctionTypeAnnotation' : case 'TypeofTypeAnnotation' : case 'OptionalIndexedAccessType' : return true ; default : return false ; } }
Sometimes we need to put parens around the object type so we produce
 a valid fix.
Sometimes we need to put parens around the object type so we produce a valid fix .