Bug 1574194 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Flow currently has "inexact" and "exact" object types, where exact objects must have _exactly_ the fields given in the type, and inexact objects must have those fields, but are also allowed to have additional properties. 

The common syntax is
```
type SomeExactObj = {| prop: string |};
type SomeInexactObj = { prop: string };
```
but in fact, the Flow team eventually wants to make `{ prop: string }` exact by default. (https://medium.com/flow-type/on-the-roadmap-exact-objects-by-default-16b72933c5cf) Along the path to this eventual goal, they have added a new "..." token to mark an object inexact:
```
type SomeInexactObj = { prop: string, ... };
```

We should update our codebase to require `...` for all types that aren't exact. That should mean

1. Enabling https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-require-inexact-type
2. Fixing all of the places in the codebase that are inexact but don't have `...`
Flow currently has "inexact" and "exact" object types, where exact objects must have _exactly_ the fields given in the type, and inexact objects must have those fields, but are also allowed to have additional properties. 

The common syntax is
```
type SomeExactObj = {| prop: string |};
type SomeInexactObj = { prop: string };
```
but in fact, the Flow team eventually wants to make `{ prop: string }` exact by default. (https://medium.com/flow-type/on-the-roadmap-exact-objects-by-default-16b72933c5cf) Along the path to this eventual goal, they have added a new "..." token to mark an object inexact:
```
type SomeInexactObj = { prop: string, ... };
```

We should update our codebase to require `...` for all types that aren't exact. That should mean

1. Enabling https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-require-inexact-type
2. Fixing all of the places in the codebase that are inexact but don't have `...`

I would recommend approaching this bug with a few steps
1. Figure out what we need to do to enable `eslint-plugin-flowtype` in `mozilla-central`, since right now it is not an ESLint plugin that we load.
2. Instead of manually fixing every instance of an inexact object, use this as motivation to submit a patch to `eslint-plugin-flowtype` to use ESlint's autofix framework to fix all the issues _for_ you, that way you can run ESLint with `--fix` to update all the debugger code.
3. Submit a patch adding `...` everywhere.

Back to Bug 1574194 Comment 0