Skip to content

Instantly share code, notes, and snippets.

@ziqichen6
ziqichen6 / gist:246e5778617224d2b4aff198dab0305d
Created August 6, 2018 23:50
jscodeshift script to replace "accessibilityTraits" and "accessibilityComponentType" with "accessibilityStates" and "accessibilityRole"
'use strict';
export default function transformer(file, api) {
const j = api.jscodeshift;
const root = j(file.source);
let hasChanges = false;
const elements = root.find(j.JSXElement);
let values;
let valuess;