The newer javascript specs include many syntax shorthands. The following are all equivalent, defining a function that creates an object with a specified title and the option to define a non-default list.
- Definition
- A tool for large-scale codebase refactors. In this case, it's a script that is run against the files you wish to change
- When regex/find and replace isn't enough. Needing the context of the surrounding code and its meaning
- How? Abstract Syntax Trees!
Converts factory-style React to React.createElement style. This can then be fed to react-codemod's create-element-to-jsx. Along the way, it'll also add a React import when needed and remove react-dom-factories imports.
Run using jscodeshift like so:
jscodeshift -t /path/to/factory-to-create-element.js /directory/to/transform/**/*.js
I hereby claim:
- I am zachgawlik on github.
- I am zachg (https://keybase.io/zachg) on keybase.
- I have a public key ASBUEOP-Y10P9tw1QChMhSH1tr21OK6UnCb2k_-gwbAZ7Qo
To claim this, I am signing this object:
This file contains 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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |