Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/conorhastings/react-style-px-suffix-codemod
append px to shorthand values in style objects in react in prep for react 15 warning
https://github.com/conorhastings/react-style-px-suffix-codemod
Last synced: 22 days ago
JSON representation
append px to shorthand values in style objects in react in prep for react 15 warning
- Host: GitHub
- URL: https://github.com/conorhastings/react-style-px-suffix-codemod
- Owner: conorhastings
- Created: 2016-04-03T15:57:26.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-04T16:43:42.000Z (almost 9 years ago)
- Last Synced: 2024-12-24T11:40:44.144Z (about 2 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-codemods - react-style-px-suffix-codemod - Append px to shorthand values in style objects in react in prep for react 15 warning. (Frameworks / React.js)
README
# react-style-px-suffix-codemod
[![Circle CI](https://circleci.com/gh/conorhastings/react-style-px-suffix-codemod.svg?style=svg)](https://circleci.com/gh/conorhastings/react-style-px-suffix-codemod)
Starting with React 15, React will warn that unitless values will no longer be appended with `px` and the appending will be removed in future versions of react,this is a codemod that finds unitless specifications in your code and appends with `px`.
## use
* `npm install jscodeshift -g`
* `npm install react-style-px-suffix-codemod`
* run this script with `jscodeshift -t node_modules/react-style-px-suffix-codemod `## options
It is also possible to pass a `--ignore` flag when running to specify properties that you do not want to have px appended, example below. The properties should be comma delimited
`jscodeshift -t --ignore=fontSize,hats`