-
Notifications
You must be signed in to change notification settings - Fork 47.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE] enable prettier for flow fixtures
Since switching to `hermes-parser`, we can parse all flow syntax and no longer need to exclude these fixtures from prettier.
- Loading branch information
Showing
31 changed files
with
98 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...plugin-react-compiler/src/__tests__/fixtures/compiler/component-declaration-basic.flow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// @flow @compilationMode(infer) | ||
// @flow @compilationMode(infer) | ||
export default component Foo(bar: number) { | ||
return <Bar bar={bar} />; | ||
} | ||
|
||
function shouldNotCompile() {} | ||
function shouldNotCompile() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ export const FIXTURE_ENTRYPOINT = { | |
fn: Component, | ||
params: [{y: []}], | ||
}; | ||
|
||
``` | ||
|
||
## Code | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ function Component(props) { | |
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{y: []}], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...-react-compiler/src/__tests__/fixtures/compiler/error.component-syntax-ref-gating.flow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// @flow @gating | ||
component Foo(ref: React.RefSetter<Controls>) { | ||
return <Bar ref={ref}/>; | ||
} | ||
return <Bar ref={ref} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...react-compiler/src/__tests__/fixtures/compiler/gating-with-hoisted-type-reference.flow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...abel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-declaration-basic.flow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// @flow @compilationMode(infer) | ||
// @flow @compilationMode(infer) | ||
export default hook useFoo(bar: number) { | ||
return [bar]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = { | |
fn: Component, | ||
params: [{}], | ||
isComponent: false, | ||
} | ||
}; | ||
|
||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ export const FIXTURE_ENTRYPOINT = { | |
fn: Component, | ||
params: [{}], | ||
isComponent: false, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 18 additions & 15 deletions
33
...ct-compiler/src/__tests__/fixtures/compiler/jsx-attribute-with-jsx-fragment-value.flow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
// @flow | ||
import { Stringify } from "shared-runtime"; | ||
import {Stringify} from 'shared-runtime'; | ||
|
||
function Component({items}) { | ||
// Per the spec, <Foo value=<>{...}</> /> is valid. | ||
// But many tools don't allow fragments as jsx attribute values, | ||
// so we ensure not to emit them wrapped in an expression container | ||
return items.length > 0 | ||
? ( | ||
<Foo value={ | ||
<>{items.map(item => <Stringify key={item.id} item={item} />)}</> | ||
}></Foo> | ||
) | ||
: null; | ||
// Per the spec, <Foo value=<>{...}</> /> is valid. | ||
// But many tools don't allow fragments as jsx attribute values, | ||
// so we ensure not to emit them wrapped in an expression container | ||
return items.length > 0 ? ( | ||
<Foo | ||
value={ | ||
<> | ||
{items.map(item => ( | ||
<Stringify key={item.id} item={item} /> | ||
))} | ||
</> | ||
}></Foo> | ||
) : null; | ||
} | ||
|
||
function Foo({value}) { | ||
return <div>{value}</div>; | ||
return <div>{value}</div>; | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{items: [{id: 1, name: 'One!'}]}], | ||
}; | ||
fn: Component, | ||
params: [{items: [{id: 1, name: 'One!'}]}], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 2 additions & 5 deletions
7
...mpiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useMemo-with-refs.flow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ export const FIXTURE_ENTRYPOINT = { | |
fn: Component, | ||
params: [{name: 'Mofei'}], | ||
}; | ||
|
||
``` | ||
|
||
## Code | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ function Component(props) { | |
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{name: 'Mofei'}], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...mpiler/src/__tests__/fixtures/compiler/type-annotations/type-annotation-as-array_.flow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// @flow @enableUseTypeAnnotations | ||
import { identity, makeArray } from "shared-runtime"; | ||
import {identity, makeArray} from 'shared-runtime'; | ||
|
||
function Component(props: { id: number }) { | ||
function Component(props: {id: number}) { | ||
const x = (makeArray(props.id): Array<number>); | ||
const y = x.at(0); | ||
return y; | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{ id: 42 }], | ||
params: [{id: 42}], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...piler/src/__tests__/fixtures/compiler/type-annotations/type-annotation-as-number_.flow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.