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

eslint-plugin-fb-flow

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-fb-flow - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

rules/flow-enums-default-if-possible.js

7

CHANGELOG.md

@@ -0,4 +1,9 @@

# 0.0.2
- Added rule `use-exact-by-default-object-type`
- Added rule `use-flow-enums`
- Added rule `flow-enums-default-if-possible`
- Added rule `no-flow-enums-object-mapping`
# 0.0.1
- Initial version
- Added rule `use-indexed-access-type`

2

package.json
{
"name": "eslint-plugin-fb-flow",
"version": "0.0.1",
"version": "0.0.2",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "This is a set of ESLint rules created and published by the Flow team. They are in addition to (not a replacement for) the rules of `eslint-plugin-flowtype` created and published by the open-source community.",

@@ -58,1 +58,28 @@ # eslint-plugin-fb-flow

An auto-fixer can't just naively wrap the whole thing with `$NonMaybeType` as the type of the property at `K` might be nullable, so doing so would remove that nullability.
### `use-exact-by-default-object-type`
For Flow projects which turn on [exact objects by default](https://flow.org/en/docs/types/objects/#toc-explicit-inexact-object-types),
this ESLint rule enforces that you use the `{ prop: type }` syntax for exact object types instead of the `{| prop: type |}` syntax.
This rules includes an autofixer that transforms `{| prop: type |}` into `{ prop: type }`.
#### Invalid
```
type Props = {|
foo: string,
|};
```
#### Valid
```
type Props = {
foo: string,
};
```
```
type InexactProps = {
foo: string,
...
};
```
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