Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flow-upgrade

Package Overview
Dependencies
Maintainers
9
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow-upgrade - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

dist/codemods/removeExplicitlyExactObjectTypeSyntax.js

8

dist/upgrades/index.js

@@ -8,6 +8,8 @@ "use strict";

var _ = _interopRequireDefault(require("./0.170.0"));
var _ = _interopRequireDefault(require("./0.84.0"));
var _2 = _interopRequireDefault(require("./0.176.0"));
var _2 = _interopRequireDefault(require("./0.170.0"));
var _3 = _interopRequireDefault(require("./0.176.0"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -29,3 +31,3 @@

*/
const VERSION_UPGRADES = [_.default, _2.default];
const VERSION_UPGRADES = [_.default, _2.default, _3.default];
exports.VERSION_UPGRADES = VERSION_UPGRADES;
{
"name": "flow-upgrade",
"version": "2.0.3",
"version": "2.1.0",
"description": "A utility for upgrading your codebase to the latest version of Flow.",

@@ -44,3 +44,3 @@ "engines": {

"peerDependencies": {
"prettier": "^2.4.1"
"prettier": "2.7.1"
},

@@ -55,4 +55,4 @@ "devDependencies": {

"memfs": "^3.4.3",
"prettier": "^2.4.1"
"prettier": "2.7.1"
}
}

@@ -41,5 +41,39 @@ # `flow-upgrade`

Path to a `.prettierrc` file to use.
Upgrade codemods rely upon [`prettier`][] to print the resulting code after transformation.
Upgrade codemods rely upon [`prettier`](https://www.npmjs.com/package/prettier) to print the resulting code after transformation.
If this is not provided, we will just use the defaults.
[`prettier`]: https://www.npmjs.com/package/prettier
## Codemods available
### Collapse object initialization
Converts static object assignments (e.g. `const o = {}; o.a = 1;`) to inline properties (e.g. `const o = {a: 1};`).
Run with `yarn run flow-codemod collapseObjectInitialization`.
### Convert type parameter bound exact empty object to inexact
Replaces `T: {}` with `T: {...}` in type parameter bounds. The former is almost always wrong.
Run with `yarn run flow-codemod typeParameterBoundExactEmptyObjectToInexact`.
### Convert implicit inexact object types
Converts implicitly inexact object type syntax `{}` to explicitly inexact `{...}`.
Run with `yarn run flow-codemod convertImplicitInexactObjectTypes`.
### Remove explicitly exact object type syntax
Converts explicitly exact object type syntax `{| |}` to be just be `{ }`. To be done after you turn on `exact_by_default=true` in your `.flowconfig`.
Run with `yarn run flow-codemod removeExplicitlyExactObjectTypeSyntax`.
### Remove annotations in destructuring
Removes annotations nested inside of destructuring (e.g. `const [o: number] = foo;`). These are not valid Flow syntax.
Run with `yarn run flow-codemod removeAnnotationsInDestructuring`.
Part of upgrade to 0.176
### Remove duplicate class properties
Removes useless duplicate class properties and fixes bad constructor binding in those classes.
Run with `yarn run flow-codemod removeDuplicateClassProperties`.
Part of upgrade to 0.170
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc