repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/quote-props/classes.js | tests/format/flow/quote-props/classes.js | class A {
a = "a"
};
class B {
'b' = "b"
};
class C {
c1 = "c1"
'c2' = "c2"
};
class D {
d1 = "d1"
'd-2' = "d2"
};
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/quote-props/with_numbers.js | tests/format/flow/quote-props/with_numbers.js | obj = {
foo: "",
1: ""
};
obj = {
"bar": "",
1: ""
};
obj = {
"foo-bar": "",
1: ""
};
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/quote-props/with_member_expressions.js | tests/format/flow/quote-props/with_member_expressions.js | const obj = {
foo: "",
[foo.bar]: ""
};
class Foo {
foo() {}
[foo.bar]() {}
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/quote-props/objects.js | tests/format/flow/quote-props/objects.js | const a = {
a: "a"
};
const b = {
'b': "b"
};
const b2 = {
// Escapes should stay as escapes and not be unquoted.
'\u0062': "b",
'\u0031': "1"
};
const c = {
c1: "c1",
'c2': "c2"
};
const d = {
d1: "d1",
'd-2': "d2"
};
// None of these should become quoted, regardless of the quoteProps value.
con... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/quote-props/format.test.js | tests/format/flow/quote-props/format.test.js | runFormatTest(import.meta, ["flow"], {
quoteProps: "as-needed",
});
runFormatTest(import.meta, ["flow"], {
quoteProps: "preserve",
});
runFormatTest(import.meta, ["flow"], {
quoteProps: "consistent",
});
runFormatTest(import.meta, ["flow"], {
quoteProps: "consistent",
singleQuote: true,
});
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/range/declare-export-declaration.js | tests/format/flow/range/declare-export-declaration.js | declare export function graphql<Props, Variables, Component: React$ComponentType<Props>>
(query: GQLDocument, config?: Config<Props, QueryConfigOptions<Variables>>):
(Component: Component) => React$ComponentType<$Diff<React$ElementConfig<Component>, {
data: Object|<<<PRETTIER_RANGE_START>>>void<<<PRETTIER_RANGE... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/range/type-parameter-declaration.js | tests/format/flow/range/type-parameter-declaration.js | declare export function graphql<Props, <<<PRETTIER_RANGE_START>>>Variables<<<PRETTIER_RANGE_END>>>, Component: React$ComponentType<Props>>
(query: GQLDocument, config?: Config<Props, QueryConfigOptions<Variables>>):
(Component: Component) => React$ComponentType<$Diff<React$ElementConfig<Component>, {
data: Obje... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/range/format.test.js | tests/format/flow/range/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/method-chain/18136-flow/18136.js | tests/format/flow/method-chain/18136-flow/18136.js | const defaultColorDecoratorsEnablement = accessor.get(IConfigurationService)
.getValue<"auto" | "always" | "never">(
"longlonglonglonglonglonglonglonglong",
);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/method-chain/18136-flow/format.test.js | tests/format/flow/method-chain/18136-flow/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/jsx/func_inside_attr.js | tests/format/flow/jsx/func_inside_attr.js | <bar x={function (x): Array<string> {}} />
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/jsx/return_type.js | tests/format/flow/jsx/return_type.js | const fail = (): X => <x />;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/jsx/generic-component.js | tests/format/flow/jsx/generic-component.js | const c1 = <MyComponent<number> data={12} />
const c2 = <MyComponent<number> />
const c3 = <MyComponent<number> attr="value" />
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/jsx/format.test.js | tests/format/flow/jsx/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/last-argument-expansion/break.js | tests/format/flow/last-argument-expansion/break.js | export default class AddAssetHtmlPlugin {
apply(compiler: WebpackCompilerType) {
compiler.plugin('compilation', (compilation: WebpackCompilationType) => {
compilation.plugin('html-webpack-plugin-before-html', (callback: Callback<any>) => {
addAllAssetsToCompilation(this.assets, compilation, htmlPlug... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/last-argument-expansion/edge_case.js | tests/format/flow/last-argument-expansion/edge_case.js | var listener = DOM.listen(
introCard,
'click',
sigil,
(event: JavelinEvent): void =>
BanzaiLogger.log(
config,
{...logData, ...DataStore.get(event.getNode(sigil))},
),
);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/last-argument-expansion/decorated-function.js | tests/format/flow/last-argument-expansion/decorated-function.js | const Counter = decorator("my-counter")(
(props: { initialCount?: number; label?: string }) => {
const p = useDefault(props, {
initialCount: 0,
label: "Counter",
});
const [s, set] = useState({ count: p.initialCount });
const onClick = () => set("count", (it) => it + 1);
return () =>... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/last-argument-expansion/format.test.js | tests/format/flow/last-argument-expansion/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/decorator/comments.js | tests/format/flow/decorator/comments.js | class Something {
@Annotateme()
// comment
static property: Array<string>;
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/decorator/mobx.js | tests/format/flow/decorator/mobx.js | import {observable} from "mobx";
@observer class OrderLine {
@observable price:number = 0;
@observable amount:number = 1;
constructor(price) {
this.price = price;
}
@computed get total() {
return this.price * this.amount;
}
@action.bound setPrice(price) {
this.price = price;
}
@comput... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/decorator/format.test.js | tests/format/flow/decorator/format.test.js | // TODO: Run tests with `flow` parser https://github.com/facebook/flow/issues/9003
runFormatTest(import.meta, ["babel-flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/declare-class/indexer.js | tests/format/flow/declare-class/indexer.js | declare class A {
[number]: boolean;
static [string]: boolean;
}
// Read-only
declare class B {
+[number]: boolean;
static +[string]: boolean;
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/declare-class/format.test.js | tests/format/flow/declare-class/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/ignore/ignore.js | tests/format/flow/ignore/ignore.js | function a() {
// Incorrectly indented on purpose
function f</* prettier-ignore */ T : B>(
a : Array < number > // prettier-ignore
) {
call(
f( 1 )
// prettier-ignore
)
}
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/ignore/type-cast-expression.js | tests/format/flow/ignore/type-cast-expression.js | transform(
// prettier-ignore
(pointTransformer: T)
);
transform(
// prettier-ignore
(/* comment */pointTransformer: T /* comment */)
);
transform(
/* prettier-ignore */(/* prettier-ignore */pointTransformer: (Point => Point))
);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/ignore/format.test.js | tests/format/flow/ignore/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/assignments/issue-12413.js | tests/format/flow/assignments/issue-12413.js | let emit =
defineEmits<{ (event: "ready", canvas: HTMLCanvasElement): void; (event:"resize",canvas:HTMLCanvasElement):void; }>();
let abc =
func<{a:2,b:3,d:78,e:9,f:8,g:7,h:6,i:5,j:4,k:3,l:2,m:1,n:0,o:9,p:8,q:7,r:6,s:5,t:4,u:3,v:2,w:1,x:0,y:9,z:8}>();
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/assignments/issue-10846.js | tests/format/flow/assignments/issue-10846.js | const foo1 =
call<{
prop1: string;
prop2: string;
prop3: string;
}>();
export const CallRecorderContext1 =
createContext<{
deleteRecording: (id: string) => void;
deleteAll: () => void;
} | null>(null);
export const CallRecorderContext2 = createContext<{
deleteRecording: (id: string) => v... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/assignments/issue-10850.js | tests/format/flow/assignments/issue-10850.js | const map: Map<Function, Map<string | void, { value: UnloadedDescriptor }>> =
new Map();
const ma2: Map<Function, FunctionFunctionFunctionFunctionffFunction> =
new Map();
const ma3: Map<Function, Foo<S>> = new Map();
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/assignments/format.test.js | tests/format/flow/assignments/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/interface-types/interface_types.js | tests/format/flow/interface-types/interface_types.js | type A = interface { p: string };
type B = interface extends X { p: string };
type C = interface extends X, Y { p: string };
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/interface-types/format.test.js | tests/format/flow/interface-types/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/interface-types/break/break.js | tests/format/flow/interface-types/break/break.js | export interface Environment1 extends GenericEnvironment<
SomeType,
AnotherType,
YetAnotherType,
> {
m(): void;
};
export class Environment1____ extends GenericEnvironment<
SomeType,
AnotherType,
YetAnotherType,
> {
m() {};
};
export class Environment2 extends GenericEnvironment<
SomeType,
AnotherTy... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/interface-types/break/format.test.js | tests/format/flow/interface-types/break/format.test.js | runFormatTest(import.meta, ["flow"], { trailingComma: "none" });
runFormatTest(import.meta, ["flow"], { trailingComma: "es5" });
runFormatTest(import.meta, ["flow"], { trailingComma: "all" });
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/method/method.js | tests/format/flow/method/method.js | type T = { method: () => void };
type T2 = { method(): void };
declare class X { method(): void }
declare function f(): void;
var f: () => void;
declare class X {
static deserialize(): mixed,
static deserialize: () => mixed,
}
interface I {
static(): number;
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/method/consistent-breaking.js | tests/format/flow/method/consistent-breaking.js | class Foo1 {
flowParseFunctionTypeParams(
params: N.FlowFunctionTypeParam[] = [],
): { params: N.FlowFunctionTypeParam[], rest: ?N.FlowFunctionTypeParam } {
// ...
}
}
type Foo2 = {
flowParseFunctionTypeParams(
params: N.FlowFunctionTypeParam[]
): { params: N.FlowFunctionTypeParam[], rest: ?N.Flo... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/method/comment.js | tests/format/flow/method/comment.js | type Foo = {
method(
arg: number, // I belong with baz
qux: string
) : void
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/method/format.test.js | tests/format/flow/method/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/conditional-types/new-ternary-spec.js | tests/format/flow/conditional-types/new-ternary-spec.js | // @flow
// TypeScript examples:
type TypeName<T> =
T extends string ? "string"
: T extends number ? "number"
: T extends boolean ? "boolean"
: T extends undefined ? "undefined"
: T extends Function ? "function"
: "object";
type Unpacked<T> =
T extends (infer U)[] ? U
: T extends (...args: any[]) => i... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/conditional-types/infer-type.js | tests/format/flow/conditional-types/infer-type.js | // @flow
type TestReturnType<T extends (...args: any[]) => any> = T extends (...args: any[]) => infer R ? R : any;
type Unpacked<T> =
T extends (infer U)[] ? U :
T extends (...args: any[]) => infer U ? U :
T extends Promise<infer U> ? U :
T;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/conditional-types/conditional-types.js | tests/format/flow/conditional-types/conditional-types.js | // @flow
export type DeepReadonly<T> = T extends any[] ? DeepReadonlyArray<T[number]> : T extends object ? DeepReadonlyObject<T> : T;
interface DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {}
type TypeName<T> =
T extends string ? "string" :
T extends number ? "number" :
T extends boolean ? "bool... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/conditional-types/comments-in-type-annotation.js | tests/format/flow/conditional-types/comments-in-type-annotation.js | type A = () => infer R extends/* comment */ string
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/conditional-types/cursor.js | tests/format/flow/conditional-types/cursor.js | type A = () => infer R extends <|>string
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/conditional-types/nested-in-condition.js | tests/format/flow/conditional-types/nested-in-condition.js | // @flow
type Foo =
(ThingamabobberFactory extends AbstractThingamabobberFactory ? GobbledygookProvider : CompositeGobbledygookProvider) extends
DoubleGobbledygookProvider
? UniqueDalgametreService
: CompositeZamazingoResolver;
type Foo2 =
DoubleGobbledygookProvider extends
(ThingamabobberFactory exte... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/conditional-types/parentheses.js | tests/format/flow/conditional-types/parentheses.js | // @flow
// #13275
type Foo<T> = T extends ((...a: any[]) => infer R extends string) ? R : never;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/conditional-types/format.test.js | tests/format/flow/conditional-types/format.test.js | runFormatTest(import.meta, ["flow", "typescript"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/conditional-types/parentheses/union.js | tests/format/flow/conditional-types/parentheses/union.js | type T<U> = 'a' | ('b' extends U ? 'c' : empty);
type T<U> = 'a' & ('b' extends U ? 'c' : empty);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/conditional-types/parentheses/format.test.js | tests/format/flow/conditional-types/parentheses/format.test.js | runFormatTest(import.meta, ["flow", "typescript"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/type-parameters/simple-types.js | tests/format/flow/type-parameters/simple-types.js | const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<bigint> = a;
const foo2: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<1n> = a;
const foo3: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<1_1n> = a;
const foo4: Fooooooooooooooooooooooooo... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/type-parameters/format.test.js | tests/format/flow/type-parameters/format.test.js | runFormatTest(import.meta, ["flow", "typescript"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/type-parameters/flow-only/comments.js | tests/format/flow/type-parameters/flow-only/comments.js | type A<T: string/* comment */> = B;
type A<T: /* comment */string> = B;
type A<T:/* comment */ string> = B;
type A<T /* comment */:string> = B;
type A<T/* comment */ :string> = B;
type A</* comment */T :string> = B;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/type-parameters/flow-only/empty_generic_break.js | tests/format/flow/type-parameters/flow-only/empty_generic_break.js | class X {
a: B<> = SuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperLong;
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/type-parameters/flow-only/const-type-params.js | tests/format/flow/type-parameters/flow-only/const-type-params.js | // Simple
type T<const X> = X;
function f<const T>(): void {}
<const T>(x: T) => {}
class C<const T>{}
// With variance
type T<const +X> = X;
function f<const +T>(): void {}
<const +T>(x: T) => {}
class D<const +T>{}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/type-parameters/flow-only/format.test.js | tests/format/flow/type-parameters/flow-only/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/type-parameters/trailing-comma/type-paramters.js | tests/format/flow/type-parameters/trailing-comma/type-paramters.js | type FooThisNameIsVeryLongSoThatItBreaksToTheNextLine = Something<FirstParam, SecondParam>;
type ShortName = Something<FirstParam, SecondParam>;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/type-parameters/trailing-comma/format.test.js | tests/format/flow/type-parameters/trailing-comma/format.test.js | runFormatTest(import.meta, ["flow"], { trailingComma: "none" });
runFormatTest(import.meta, ["flow"], { trailingComma: "es5" });
runFormatTest(import.meta, ["flow"], { trailingComma: "all" });
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/declare-opaque-type/issue-13848.js | tests/format/flow/declare-opaque-type/issue-13848.js | /**
*/
/**
*/
declare opaque type Type: string;
/* ! DON'T add code before comment */
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/declare-opaque-type/issue-13848-2.js | tests/format/flow/declare-opaque-type/issue-13848-2.js | /**
*/
/**
*/
declare opaque type Type1: string;
declare opaque type Type2: string;
/* ! DON'T add code before comment */
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/declare-opaque-type/format.test.js | tests/format/flow/declare-opaque-type/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/function-type-param/extends-bound.js | tests/format/flow/function-type-param/extends-bound.js | // @flow
type F = <T extends string>(t: T) => T;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/function-type-param/issue-5283.js | tests/format/flow/function-type-param/issue-5283.js |
let f: <A>((
(?A) => B
)) => B;
export const testFunctionOnOptionsAsArgument: <T1,a>(?a, ((?a) => T1)) => T1 = function _(Arg1, Arg2) { const result = TypesBS.testFunctionOnOptionsAsArgument((Arg1 == null ? undefined : Arg1), Arg2); return result };
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/function-type-param/format.test.js | tests/format/flow/function-type-param/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/object-property-comment/comment.js | tests/format/flow/object-property-comment/comment.js | o = {
name:
// Comment A
// Comment B
(({id: type}: any): CreativeConcept),
};
o = {
name: // Comment A
// Comment B
(({ id: type }: any): CreativeConcept)
};
o = {
name: // Comment B // Comment A
(({ id: type }: any): CreativeConcept)
};
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/object-property-comment/format.test.js | tests/format/flow/object-property-comment/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/as-satisfies-expression/return.js | tests/format/flow/as-satisfies-expression/return.js | // @flow
function foo() {
return {
foo: 1,
bar: 2,
} as Foo;
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/as-satisfies-expression/export_default_as.js | tests/format/flow/as-satisfies-expression/export_default_as.js | // @flow
export default (function log() {} as typeof console.log)
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/as-satisfies-expression/as.js | tests/format/flow/as-satisfies-expression/as.js | // @flow
const name = (description as Description).name || (description as string);
this.isTabActionBar((e.target || e.srcElement) as HTMLElement);
(originalError ? wrappedError(errMsg, originalError) : Error(errMsg)) as InjectionError;
'current' in (props.pagination as {...});
('current' in props.pagination) as {...}... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/as-satisfies-expression/assignment.js | tests/format/flow/as-satisfies-expression/assignment.js | // @flow
const TYPE_MAP = {
'character device': 'special',
'character special file': 'special',
directory: 'directory',
'regular file': 'file',
socket: 'socket',
'symbolic link': 'link',
} as Foo;
this.previewPlayerHandle = (setInterval(async () => {
if (this.previewIsPlaying) {
await th... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/as-satisfies-expression/nested-await-and-as.js | tests/format/flow/as-satisfies-expression/nested-await-and-as.js | // @flow
const getAccountCount = async () =>
(await
((await (
await focusOnSection(BOOKMARKED_PROJECTS_SECTION_NAME)
).findItem("My bookmarks")) as TreeItem
).getChildren()
).length
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/as-satisfies-expression/as-const.js | tests/format/flow/as-satisfies-expression/as-const.js | // @flow
export const LOG_LEVEL = {
EMERGENCY: 0,
ALERT: 1,
CRITICAL: 2,
ERROR: 3,
WARNING: 4,
NOTICE: 5,
INFO: 6,
DEBUG: 7,
} as const;
(type) as const;
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/as-satisfies-expression/satisfies.js | tests/format/flow/as-satisfies-expression/satisfies.js | // @flow
const x = y satisfies T;
// demonstrating how "satisfies" expression can be practically used as expression statement.
const _ = (type: 'foo' | 'bar') => {
switch (type) {
case 'foo':
return 1;
case 'bar':
return 2;
default:
// exhaustiveness check idiom
(type) satisfies empty;
throw... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/as-satisfies-expression/long-identifiers.js | tests/format/flow/as-satisfies-expression/long-identifiers.js | // @flow
const bifornCringerMoshedPerplexSawder =
askTrovenaBeenaDependsRowans as glimseGlyphsHazardNoopsTieTie;
averredBathersBoxroomBuggyNurl.anodyneCondosMalateOverateRetinol =
annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave;
averredBathersBoxroomBuggyNurl = {
anodyneCondosMalateOverateReti... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/as-satisfies-expression/format.test.js | tests/format/flow/as-satisfies-expression/format.test.js | runFormatTest(import.meta, ["flow"], {
errors: {
hermes: ["satisfies.js", "ternary.js"],
},
});
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/as-satisfies-expression/ternary.js | tests/format/flow/as-satisfies-expression/ternary.js | // @flow
foo = (coooooooooooooooooooooooooooooooooooooooooooooooooooond
? baaaaaaaaaaaaaaaaaaaaar
: baaaaaaaaaaaaaaaaaaaaaz) as Fooooooooooo;
foo = (condition ? firstValue : secondValue) as SomeType;
const foo = (coooooooooooooooooooooooooooooooooooooooooooooooooooond
? baaaaaaaaaaaaaaaaaaaaar
: baaaaaaa... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/annotation/array_of_functions.js | tests/format/flow/annotation/array_of_functions.js | const actionArray: (() => void)[] = [];
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/annotation/format.test.js | tests/format/flow/annotation/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/declare-interface/declare-interface.js | tests/format/flow/declare-interface/declare-interface.js | declare export interface A {
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/declare-interface/format.test.js | tests/format/flow/declare-interface/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/await/await-keywords.js | tests/format/flow/await/await-keywords.js | export class C1 {
p = await (0);
}
await (0);
async function foo() {
function bar(x = await (2)) {}
}
export class C2 {
p = await 0;
}
function foo(promise) { await (promise); }
function a() {
return await (1)
}
() => { await (x) };
function foo() {
await
(foo);
}
export class C {
p = await (0);
}... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/await/format.test.js | tests/format/flow/await/format.test.js | runFormatTest(import.meta, ["flow"], {
errors: {
hermes: ["await-keywords.js"],
},
});
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/object-multiline/multiline.js | tests/format/flow/object-multiline/multiline.js | type A = {
name1: 'value1',
name2: 'value2',
};
const a: A = {
name1: 'value1',
name2: 'value2',
};
type B = { name1: 'value1',
name2: 'value2',
};
const b: B = { name1: 'value1',
name2: 'value2',
};
type C = {
name1: 'value1', name2: 'value2',
};
const c: C = {
name1: 'value1', name2: 'value2',
};... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/object-multiline/format.test.js | tests/format/flow/object-multiline/format.test.js | runFormatTest(import.meta, ["flow"]);
runFormatTest(import.meta, ["flow"], { objectWrap: "collapse" });
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/type_annotations.js | tests/format/flow/comments/type_annotations.js | new (window.Request/*: Class<Request> */)("");
(this/*: any */).foo = 5;
(this/* : any */).foo = 5;
// This next example illustrates that Prettier will not remove a line break
// and unintentionally create a type annotation that was not there before.
(this/*
: any */).foo = 5;
const x = (input /*: string */) /*:... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/generics.js | tests/format/flow/comments/generics.js | const Component = branch/*:: <Props, ExternalProps> */(
({ src }) => !src,
// $FlowFixMe
renderNothing,
)(BaseComponent);
const C = b/*:: <A> */(foo) + c/*:: <B> */(bar);
foo/*::<bar>*/(baz);
foo/*::<bar>*/();
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/interface.js | tests/format/flow/comments/interface.js | interface Foo {
bar(
currentRequest: {a: number},
// TODO this is a very very very very long comment that makes it go > 80 columns
): number;
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/functions2.js | tests/format/flow/comments/functions2.js | function f1(a /* b */ /*: c */){}
function f2(a /* b */ : c ){}
function f3(a /* b */ /* : c */){}
function f4(a /* b */ /*:: : c */){}
function f2(a : /* b */ c ){}
function f2(a : c /* b */ ){}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/type_annotations-2.js | tests/format/flow/comments/type_annotations-2.js | foo/*::<bar>*/(baz);
class Foo {
bar( data: Array<string>) {}
} | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/arrow.js | tests/format/flow/comments/arrow.js | // Error
const a = (data/*: Object */) => {}
// OK
const b = (data/*: Object */, secondData/*: Object */) => {}
const c = (data/*: /* this is an object *-/ Object */) => {};
const run = (cmd /*: string */) /*: Promise<void> */ => {}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/class.js | tests/format/flow/comments/class.js | class A {
x /*: string */;
method(a /*: T */, b /*: T */) /*: T */ {}
}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/union.js | tests/format/flow/comments/union.js | type UploadState<E, EM, D>
// The upload hasnt begun yet
= {type: "Not_begun"}
// The upload timed out
| {type: "Timed_out"}
// Failed somewhere on the line
| {type: "Failed", error: E, errorMsg: EM}
// Uploading to aws3 and CreatePostMutation succeeded
| {type: "Success", data: D};
type UploadState2<E... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/type_annotations-3.js | tests/format/flow/comments/type_annotations-3.js | import type { OneType } from './oneFile.js'
/*::
import type { HelloType } from './otherFile.js'
*/
type PropTypes = {|
TestComponent: React.AbstractComponent<any>,
hello: HelloType,
|}; | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/cast.js | tests/format/flow/comments/cast.js | (a /* b */ /*: c */);
(a /* b */ : c );
(a /* b */ /* : c */);
(a /* b */ /*:: : c */);
(a /* b */ /* :: : c */);
(a : /* b */ c );
(a : c /* b */ );
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/functions.js | tests/format/flow/comments/functions.js | function foo<T>(bar /*: T[] */, baz /*: T */) /*: S */ {}
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/issues.js | tests/format/flow/comments/issues.js | // Adding a comment stops the pretty printing process and everything is
// squished in a single line afterward
export type BuckWebSocketMessage = {
// Not actually from Buck - this is to let the receiver know that the socket is connected.
type: 'SocketConnected',
} | {
type: 'BuildProgressUpdated',
progressValu... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/object_type_annotation.js | tests/format/flow/comments/object_type_annotation.js | type Props1 = // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!!
{
isPlaying: boolean,
};
type Props2 = { // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!!
isPlaying: boolean
};
type Props3 = {
// (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!!
isPlaying: boolean
... | javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/let.js | tests/format/flow/comments/let.js | let foo /*: Groups<T> */;
let bar /*: string */ = 'a';
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/format.test.js | tests/format/flow/comments/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/normal-comments/11526.js | tests/format/flow/comments/normal-comments/11526.js | type Foo = {
bar: // test
| {loooooooooooooooooongPropName1: string}
| {loooooooooooooooooongPropName2: string},
};
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/comments/normal-comments/format.test.js | tests/format/flow/comments/normal-comments/format.test.js | runFormatTest(import.meta, ["flow"]);
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
prettier/prettier | https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow/optional-indexed-access/optional-indexed-access.js | tests/format/flow/optional-indexed-access/optional-indexed-access.js | type A = Obj?.['foo'];
type B = Obj?.['foo']['bar'];
type C = Obj['foo']?.['bar'];
type D = (Obj?.['foo'])['bar'];
type E = (T & S)?.['bar'];
type F = (T | S)?.['bar'];
type G = (?T)?.['bar'];
type H = (typeof x)?.['bar'];
type I = (string => void)?.['bar'];
| javascript | MIT | ae0e00df55d47274cc53db8d2cdcd064849e088d | 2026-01-04T14:57:20.107180Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.