eslint-plugin-fb-flow
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -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` |
{ | ||
"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, | ||
... | ||
}; | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16564
10
434
85