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-repo/more_statics/class_static.js
tests/format/flow-repo/more_statics/class_static.js
class B { static foo(): string { return ""; } } class C extends B { static bar(): string { return ""; } } var x: number = C.bar(); var y: number = C.foo();
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/more_statics/format.test.js
tests/format/flow-repo/more_statics/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-repo/jsx_intrinsics.custom/strings.js
tests/format/flow-repo/jsx_intrinsics.custom/strings.js
/* @flow */ var React = require('react'); var Div = 'div'; var Bad = 'bad'; var Str: string = 'str'; <Div />; // This is fine <Bad />; // Error: 'bad' not in JSXIntrinsics <Str />; // Error: string ~> keys of JSXIntrinsics React.createElement('div', {}); // This is fine React.createElement('bad', {}); // Error: 'ba...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/jsx_intrinsics.custom/main.js
tests/format/flow-repo/jsx_intrinsics.custom/main.js
// @flow var React = require('react'); class CustomComponent extends React.Component { props: { prop: string }; } var a: React.Element<{prop: string}> = <CustomComponent prop="asdf" />; var b: React.Element<{prop1: string}> = <CustomComponent prop="asdf" />; // Error: Props<{prop}> ~> Props<{prop1}> <div id...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/jsx_intrinsics.custom/format.test.js
tests/format/flow-repo/jsx_intrinsics.custom/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-repo/jsx_intrinsics.custom/lib/jsx.js
tests/format/flow-repo/jsx_intrinsics.custom/lib/jsx.js
declare var $React: $Exports<'react'>; // fake import type $JSXIntrinsic<T> = Class<$React.Component<void,T,mixed>>; type $JSXIntrinsics = { div: $JSXIntrinsic<{id: string}>, span: $JSXIntrinsic<{id: string, class: string}>, };
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/jsx_intrinsics.custom/lib/format.test.js
tests/format/flow-repo/jsx_intrinsics.custom/lib/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-repo/array_spread/test.js
tests/format/flow-repo/array_spread/test.js
var A = [1,2,3]; var B = [...A]; var C = [1,2,3]; B.sort((a, b) => a - b); C.sort((a, b) => a - b); var x: Array<string> = ['1', '2']; var y: Array<string> = ['3', ...x];
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/array_spread/format.test.js
tests/format/flow-repo/array_spread/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-repo/iter/iter.js
tests/format/flow-repo/iter/iter.js
var a = [true,false]; function foo(x) { } for (var i=0;i<3;i++) { foo(a[i]); } for (var k in a) { foo(a[k]); // k is a string, which shouldn't be used for array access } var b = (null : ?{[key: string]: string}); for (var j in b) { foo(b[j]); } var c; for (var m in (c = b)) { foo(c[m]); } var d; for...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/iter/format.test.js
tests/format/flow-repo/iter/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-repo/fixpoint/Fun.js
tests/format/flow-repo/fixpoint/Fun.js
/* @providesModule Fun */ function eq(x:number,y:number) { return true }; function sub(x:number,y:number) { return 0; } function mul(x:number,y:number) { return 0; } function fix(fold) { var delta = function(delta) { return fold( function(x) { var eta = delta(delta); return eta(x); } ); }; return...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/fixpoint/Ycombinator.js
tests/format/flow-repo/fixpoint/Ycombinator.js
/* @providesModule Ycombinator */ function Y(f) { function g(x) { return f(x(x)); } g(g); } function func1(f) { function fix_f(x:number):number { return f(x); } return fix_f; } function func2(f) { function fix_f(x:string):string { return f(x); } return fix_f; } Y(func1); Y(func2); module.exports = Y;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/fixpoint/format.test.js
tests/format/flow-repo/fixpoint/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-repo/jsx_intrinsics.builtin/strings.js
tests/format/flow-repo/jsx_intrinsics.builtin/strings.js
/* @flow */ var React = require('react'); // The builtin $JSXIntrinsics should allow any string var Div = 'div'; var Bad = 'bad'; var Str: string = 'str'; <Div />; // This is fine <Bad />; // This is fine <Str />; // This is fine React.createElement('div', {}); // This is fine React.createElement('bad', {}); // Th...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/jsx_intrinsics.builtin/main.js
tests/format/flow-repo/jsx_intrinsics.builtin/main.js
// @flow var React = require('react'); class CustomComponent extends React.Component { props: { prop: string }; } var a: React.Element<{prop: string}> = <CustomComponent prop="asdf" />; var b: React.Element<{prop1: string}> = <CustomComponent prop="asdf" />; // Error: Props<{prop}> ~> Props<{prop1}> // Sinc...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/jsx_intrinsics.builtin/format.test.js
tests/format/flow-repo/jsx_intrinsics.builtin/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-repo/suppress_incremental/test.js
tests/format/flow-repo/suppress_incremental/test.js
// @flow (123: number); // no errors
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/suppress_incremental/format.test.js
tests/format/flow-repo/suppress_incremental/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-repo/tuples/too-few.js
tests/format/flow-repo/tuples/too-few.js
/* @flow */ function foo(a: [Object, Object]) {} foo([ {} ]); // error, too few elements in array passed to a tuple
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/tuples/array.js
tests/format/flow-repo/tuples/array.js
// @flow function foo(x: Array<number>): [number, ?number] { return x; // Error, can't enforce arity when flowing array to tuple } function foo(x: Array<number>): [number, ?number] { return [x[0], x[1]]; // OK. This is unsound, but at least arity is enforced }
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/tuples/tuples.js
tests/format/flow-repo/tuples/tuples.js
var a: [] = []; var b: [] = [123]; // Error - arity mismatch var c: [number] = []; // nope var d: [number, string] = [123,'duck']; var e: [number, string,] = [123,'duck']; var f: [number, string] = [123, 456];
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/tuples/spread.js
tests/format/flow-repo/tuples/spread.js
type A = [...S]; type B = [...foo: S];
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/tuples/optional.js
tests/format/flow-repo/tuples/optional.js
// @flow ([0, undefined]: [number, ?string]); // Ok, correct arity ([0]: [number, ?string]); // Error, arity is enforced ([]: [?number, string]); // error, since second element is not marked optional
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/tuples/format.test.js
tests/format/flow-repo/tuples/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-repo/incremental_non_flow_move/test.js
tests/format/flow-repo/incremental_non_flow_move/test.js
/** * @flow */ require('Foo');
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/incremental_non_flow_move/foo.js
tests/format/flow-repo/incremental_non_flow_move/foo.js
/* * @providesModule Foo */
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/incremental_non_flow_move/format.test.js
tests/format/flow-repo/incremental_non_flow_move/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-repo/binary/in.js
tests/format/flow-repo/binary/in.js
// @flow let tests = [ // objects on RHS function() { ('foo' in {}); ('foo' in { foo: null }); (0 in {}); (0 in { "0": null }); }, // arrays on RHS function() { ('foo' in []); (0 in []); ('length' in []); }, // primitive classes on RHS function() { ('foo' in new String...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/binary/format.test.js
tests/format/flow-repo/binary/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-repo/class_fields/base_class.js
tests/format/flow-repo/class_fields/base_class.js
// @flow class Base { unannotatedField; annotatedField: number; initializedField = 42; initializedFieldWithThis = this.initializedField; annotatedInitializedFieldValid: ?number = 42; annotatedInitializedFieldInvalid: number = 'asdf'; // Error: string ~> number static unannotatedField; static annotated...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/class_fields/derived_class.js
tests/format/flow-repo/class_fields/derived_class.js
// @flow class Base { base_unannotatedField; base_annotatedField: number; base_initializedField = 42; base_initializedFieldWithThis = this.base_initializedField; base_annotatedInitializedFieldValid: ?number = 42; base_annotatedInitializedFieldInvalid: number = 'asdf'; // Error: string ~> number static b...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/class_fields/generic_class.js
tests/format/flow-repo/class_fields/generic_class.js
// @flow /** * Fields annotated with a generic should assume a type once the type param * is instantiated. */ class ClassAnnotated<T> { p: T; static p: T; } var o1 = new ClassAnnotated(); o1.p = 42; (o1.p: number); (o1.p: string); // Error: number ~> string ClassAnnotated.p = 42; (ClassAnnotated.p: number); (C...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/class_fields/scoping.js
tests/format/flow-repo/class_fields/scoping.js
// @flow var someVar = 42; class Foo { outer = someVar; selfTyped: Foo; selfTypedInit = new Foo(); static outer = someVar; static selfTyped: Foo; static selfTypedInit = new Foo(); constructor() { var someVar = 'asdf'; } } /** * Field initializers execute in a scope immediately under the scope ...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/class_fields/format.test.js
tests/format/flow-repo/class_fields/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-repo/esproposal_export_star_as.warn/test.js
tests/format/flow-repo/esproposal_export_star_as.warn/test.js
/* @flow */ export * as foo from "./test";
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/esproposal_export_star_as.warn/format.test.js
tests/format/flow-repo/esproposal_export_star_as.warn/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-repo/builtin_uses/test.js
tests/format/flow-repo/builtin_uses/test.js
var o = Object.freeze({ foo: 0 }); (o.foo: string); module.exports = o;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/builtin_uses/test2.js
tests/format/flow-repo/builtin_uses/test2.js
var o = require('./test'); (o.foo: string);
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/builtin_uses/format.test.js
tests/format/flow-repo/builtin_uses/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-repo/object_annot/test.js
tests/format/flow-repo/object_annot/test.js
function foo(x: Array<Object>): Array<Object> { return x.sort((a, b) => a.foo - b.foo); } // Make sure Object works with Object.keys() function bar(x: Object): Array<string> { return Object.keys(x); }
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/object_annot/format.test.js
tests/format/flow-repo/object_annot/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-repo/react_modules/createclass-callsite.js
tests/format/flow-repo/react_modules/createclass-callsite.js
/* @flow */ var React = require('react'); var Hello = require('./createclass-module'); var HelloLocal = React.createClass({ propTypes: { name: React.PropTypes.string.isRequired, }, render: function(): React.Element<*> { return <div>{this.props.name}</div>; } }); var Callsite = React.createClass({ r...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/react_modules/es6class-proptypes-callsite.js
tests/format/flow-repo/react_modules/es6class-proptypes-callsite.js
/* @flow */ import React from 'react'; import Hello from './es6class-proptypes-module'; class HelloLocal extends React.Component<void, {name: string}, void> { defaultProps = {}; propTypes = { name: React.PropTypes.string.isRequired, }; render(): React.Element<*> { return <div>{this.props.name}</div>; ...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/react_modules/es6class-proptypes-module.js
tests/format/flow-repo/react_modules/es6class-proptypes-module.js
/* @flow */ import React from 'react'; class Hello extends React.Component<void, {name: string}, void> { defaultProps = {}; propTypes = { name: React.PropTypes.string.isRequired, }; render(): React.Element<*> { return <div>{this.props.name}</div>; } } module.exports = Hello;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/react_modules/es6class-types-callsite.js
tests/format/flow-repo/react_modules/es6class-types-callsite.js
/* @flow */ import React from 'react'; import Hello from './es6class-types-module'; type Props = {name: string}; class HelloLocal extends React.Component<void, Props, void> { props: Props; render(): React.Element<*> { return <div>{this.props.name}</div>; } } class Callsite extends React.Component<void, Pr...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/react_modules/es6class-types-module.js
tests/format/flow-repo/react_modules/es6class-types-module.js
/* @flow */ import React from 'react'; type Props = {name: string}; class Hello extends React.Component<{}, Props, void>{ props: Props; static defaultProps: {}; render(): React.Element<*> { return <div>{this.props.name}</div>; } } module.exports = Hello;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/react_modules/createclass-module.js
tests/format/flow-repo/react_modules/createclass-module.js
/* @flow */ var React = require('react'); var Hello = React.createClass({ propTypes: { name: React.PropTypes.string.isRequired, }, render: function(): React.Element<*> { return <div>{this.props.name}</div>; } }); module.exports = Hello;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/react_modules/format.test.js
tests/format/flow-repo/react_modules/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-repo/annot/annot.js
tests/format/flow-repo/annot/annot.js
function foo(str:string, i:number):string { return str; } var bar: (str:number, i:number)=> string = foo; var qux = function(str:string, i:number):number { return foo(str,i); } var obj: {str:string; i:number; j:boolean} = {str: "...", i: "...", k: false}; var arr: Array<number> = [1,2,"..."]; // array sugar var a...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/annot/scope.js
tests/format/flow-repo/annot/scope.js
type Merge<T> = (a: T, b: T) => T; // hypothetical immutable map declare class Map<K,V> { (): Map<K,V>; insertWith(fn: Merge<V>, k: K, v: V): Map<K,V>; } declare function foldr<A,B>(fn: (a: A, b: B) => B, b: B, as: A[]): B; function insertMany<K,V>(merge: Merge<V>, vs: [K,V][], m: Map<K,V>): Map<K,V> { functio...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/annot/test.js
tests/format/flow-repo/annot/test.js
var C = require('./other'); ((0: C): string);
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/annot/forward_ref.js
tests/format/flow-repo/annot/forward_ref.js
let myClassInstance: MyClass = null; // forward ref ok, null ~> class error function bar(): MyClass { return null; // forward ref ok, null ~> class error } class MyClass { } // looked up above function foo() { let myClassInstance: MyClass = mk(); // ok (no confusion across scopes) function mk() { return new My...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/annot/leak.js
tests/format/flow-repo/annot/leak.js
/** @flow */ /* This test documents an example we ran into of a type annotation leaking. * * When foo() calls bar(), we should make sure the type of x matches the type * annotation for y and stop. We should type the body of bar() with the type * annotation of y. * * However, the leaky type annotation meant that ...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/annot/other.js
tests/format/flow-repo/annot/other.js
class C { } module.exports = (C: any);
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/annot/issue-530.js
tests/format/flow-repo/annot/issue-530.js
function foo(...args: any) { } module.exports = foo;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/annot/format.test.js
tests/format/flow-repo/annot/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-repo/annot/any/A.js
tests/format/flow-repo/annot/any/A.js
type T = any; export default class { p: T; constructor() { this.p = 0; } }
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/annot/any/B.js
tests/format/flow-repo/annot/any/B.js
import A from "./A" class B extends A { p: string; // OK, string ~> any }
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/annot/any/format.test.js
tests/format/flow-repo/annot/any/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-repo/lib/libtest.js
tests/format/flow-repo/lib/libtest.js
var x:string = NaN var y:string = Number.MAX_VALUE; var z:number = new TypeError().name; var w:string = parseInt("..."); var a = new Map(); a.delete('foobar'); var b = undefined; if (undefined) { }
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/lib/format.test.js
tests/format/flow-repo/lib/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-repo/sketchy_null_default/test.js
tests/format/flow-repo/sketchy_null_default/test.js
/* @flow */ /* EXAMPLES NOT IN A CONDITIONAL */ //"Sketchy" checks excused by the default pattern (Not errors) var x1: ?boolean = null; x1 = x1 || false; var y1: ?number = null; y1 = y1 || 0; var z1: ?string = null; z1 = z1 || ''; //These checks aren't excused because they aren't the same as a null check //(Error...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/sketchy_null_default/format.test.js
tests/format/flow-repo/sketchy_null_default/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-repo/symlink/qux.js
tests/format/flow-repo/symlink/qux.js
import type { Foo } from './bar.js'; ({ x: "" }: Foo);
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/symlink/bar.js
tests/format/flow-repo/symlink/bar.js
export type Foo = { x: number; }
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/symlink/foo.js
tests/format/flow-repo/symlink/foo.js
export type Foo = { x: number; }
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/symlink/format.test.js
tests/format/flow-repo/symlink/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-repo/intersection/test_fun.js
tests/format/flow-repo/intersection/test_fun.js
/** * Tests for intersections of function types. * * Note: Flow abuses intersection types to model * function overloading, which precludes using a * correct intersection of return types in the result. * * Here we test the special case where return types * are equal. Tests of the overloading behavior can * be f...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/intersection/pred.js
tests/format/flow-repo/intersection/pred.js
/** * Test interaction of object intersections and predicates. * Definitions in lib/lib.js * * @flow */ type DuplexStreamOptions = ReadableStreamOptions & WritableStreamOptions & { allowHalfOpen? : boolean, readableObjectMode? : boolean, writableObjectMode? : boolean }; function hasObjectMode_bad(options: ...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/intersection/test_obj.js
tests/format/flow-repo/intersection/test_obj.js
/** * Tests for intersections of object types * * @noflow */ // TODO we should give explicit errors for incompatibilities // which make an intersection uninhabitable: // - shared mutable properties with different types // - different dictionary types // // Currently we give no such errors. Instead, we rely on // t...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/intersection/intersection.js
tests/format/flow-repo/intersection/intersection.js
function foo(x: $All<Error,{type:number}>): number { return x.type; } function bar(x: Error & {type:number}): number { return x.type; }
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/intersection/objassign.js
tests/format/flow-repo/intersection/objassign.js
/** * Test intersection of objects flowing to spread assignment. * * Definitions in lib/lib.js * * @noflow */ declare var x: ObjAssignT; let y: ObjAssignT = { ...x }; // should be fine
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/intersection/format.test.js
tests/format/flow-repo/intersection/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-repo/intersection/lib/lib.js
tests/format/flow-repo/intersection/lib/lib.js
// @flow // defs used in tests, here to stress tvar machinery // used in ObjAssign.js // type ObjAssignT = { foo: string } & { bar: string }; // used in pred.js // type ReadableStreamOptions = { highWaterMark? : number, encoding? : ?string, objectMode? : boolean }; type WritableStreamOptions = { highWaterMa...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/intersection/lib/format.test.js
tests/format/flow-repo/intersection/lib/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-repo/auxiliary/client.js
tests/format/flow-repo/auxiliary/client.js
var y:number = x;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/auxiliary/format.test.js
tests/format/flow-repo/auxiliary/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-repo/auxiliary/lib/lib.js
tests/format/flow-repo/auxiliary/lib/lib.js
declare var x: string;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/auxiliary/lib/format.test.js
tests/format/flow-repo/auxiliary/lib/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-repo/incremental_cycle_break/A.js
tests/format/flow-repo/incremental_cycle_break/A.js
/** * @providesModule A * @flow */ require('B');
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/incremental_cycle_break/B.js
tests/format/flow-repo/incremental_cycle_break/B.js
/** * @providesModule B * @flow */ require('A');
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/incremental_cycle_break/format.test.js
tests/format/flow-repo/incremental_cycle_break/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-repo/incremental_cycle_break/tmp1/A.js
tests/format/flow-repo/incremental_cycle_break/tmp1/A.js
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/incremental_cycle_break/tmp1/format.test.js
tests/format/flow-repo/incremental_cycle_break/tmp1/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-repo/class_munging/with_munging.js
tests/format/flow-repo/class_munging/with_munging.js
/** * @flow */ class Foo { _method(): string { return 'this is private'; } } class Bar extends Foo { test() { (this._method(): string); // error } }
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/class_munging/without_munging.js
tests/format/flow-repo/class_munging/without_munging.js
/** * @flow * @preventMunge */ class Foo { _method(): string { return 'this is not private'; } } class Bar extends Foo { test() { (this._method(): string); // ok } }
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/class_munging/format.test.js
tests/format/flow-repo/class_munging/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-repo/equals/equals.js
tests/format/flow-repo/equals/equals.js
/* @flow */ (1 == 1); ("foo" == "bar"); (1 == null); (null == 1); (1 == ""); // error ("" == 1); // error var x = (null : ?number); (x == 1); (1 == x);
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/equals/format.test.js
tests/format/flow-repo/equals/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-repo/arraylib/array_lib.js
tests/format/flow-repo/arraylib/array_lib.js
/* @flow */ function foo(x:string) { } var a = [0]; var b = a.map(function (x) { foo(x); return "" + x; }); var c: number = a[0]; var d: number = b[0]; var e:Array<string> = a.reverse(); var f = [""]; var g:number = f.map(function () { return 0; })[0]; var h: Array<number> = [1,2,3]; var i: Array<string> = ['a', '...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/arraylib/format.test.js
tests/format/flow-repo/arraylib/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-repo/type-at-pos/import.js
tests/format/flow-repo/type-at-pos/import.js
// @flow var num = 42; function bar() { } bar(); module.exports = num;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/type-at-pos/function_expressions.js
tests/format/flow-repo/type-at-pos/function_expressions.js
// @flow // TODO: type-at-pos between the ()'s should be () => void // class X { // foo(): void {} // } const a = { bar(): void {} }; const b = { bar: function (): void {} }; const c = { m<T>(x: T): T { return x; } }; const d = { m: function<T>(x: T): T { return x; } };
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/type-at-pos/generics.js
tests/format/flow-repo/type-at-pos/generics.js
// @flow class C<X> { } var cn: C<number> = new C; cn; function foo() { return C; } var D = foo(); var dn: D<number> = new C; dn; type E<X> = C<X>; var en: E<number> = new C; en; type F<X> = C<void>; var fn: F<number> = new C; fn; type O<X> = { x: X }; var on: O<number> = { x: 0 }; on; type Mono = C<void>; var mn...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/type-at-pos/destructuring.js
tests/format/flow-repo/type-at-pos/destructuring.js
// @flow let [x, y] = [1, 2]; /** * Test what happens when the destructuring is unevaluated. In this case, * `this` in a function is unbound, so we never actually find out the type of * `this.returnsATuple()` is; thus, we never evaluate `b` and so type-at-pos * returns EmptyT. */ export const X = { returnsATup...
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/type-at-pos/test.js
tests/format/flow-repo/type-at-pos/test.js
// @flow var str = require('./import'); function foo() { } foo(); str type Point = [number, string]; const x:Point = [1, "foo"]; type MyStr = "cool"; const y:MyStr = "cool"; type MyBool = true; const z:MyBool = true; type MyNum = 42; const w:MyNum = 42;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/type-at-pos/react.js
tests/format/flow-repo/type-at-pos/react.js
import React from "react"; React.createElement;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/type-at-pos/templates.js
tests/format/flow-repo/type-at-pos/templates.js
/* @flow */ `foo bar`;
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false
prettier/prettier
https://github.com/prettier/prettier/blob/ae0e00df55d47274cc53db8d2cdcd064849e088d/tests/format/flow-repo/type-at-pos/predicates.js
tests/format/flow-repo/type-at-pos/predicates.js
/* @flow */ let x = 0; if (x == null) {} if (x == undefined) {} if (Array.isArray(x)) {}
javascript
MIT
ae0e00df55d47274cc53db8d2cdcd064849e088d
2026-01-04T14:57:20.107180Z
false