This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Deal with `import React from 'react'` lines | |
git grep -l "import React " | xargs sed -i '' "s/import\ React\ /import\ \*\ as\ React\ /g" | |
# 2. Deal with `import React, {...} from 'react'` lines | |
# Here we need one line with `import * as React from 'react';` | |
# and the other with `import {...} from 'react;' | |
# First we remove the `import React,` part | |
# The we insert befor the line `import * as React from 'react';` | |
git grep -l "import React," | xargs sed -i '' -e "s/import\ React,/import/g" -e "import\ {.*}\ from\ 'react';/ i\\ | |
import\ \*\ as\ React\ from\ 'react';" |