Skip to content

Commit

Permalink
Formatted types/r* packages with dprint (DefinitelyTyped#66539)
Browse files Browse the repository at this point in the history
* Formatted types/r* packages with dprint

* Manually correct ts-expect-error directives

* Fixed introduced issues

* Fix introduced issues

* A few assorted fixes

* Reset troublemaker packages
  • Loading branch information
JoshuaKGoldberg authored Sep 27, 2023
1 parent 02f5cf5 commit 964e498
Show file tree
Hide file tree
Showing 3,103 changed files with 82,652 additions and 77,219 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions types/r-script/r-script-tests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import R = require('r-script');
import R = require("r-script");

function RPromise(r: R): Promise<any> {
return new Promise((resolve, reject) => {
Expand All @@ -14,7 +14,7 @@ function RPromise(r: R): Promise<any> {

const options: R.Options = {
dataframe: "rows",
anotherRandomOption: true
anotherRandomOption: true,
};
const result1 = R("foo.R").data("string data param", "another one").callSync();
const result2 = R("foo.R").data("string data param", "another one").callSync(options);
Expand Down
4 changes: 2 additions & 2 deletions types/r7insight_js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface Options {
/**
* The Insight log region
*/
region: 'eu' | 'us';
region: "eu" | "us";

/**
* Use SSL/TLS to send events
Expand All @@ -40,7 +40,7 @@ export interface Options {
/**
* Append basic information about browser capabilities
*/
page_info?: 'never' | 'per-page' | 'per-entry';
page_info?: "never" | "per-page" | "per-entry";

/**
* Echo events to the screen via the console object. This will logged at the same level as the call to R7Insight, e.g. R7Insight.warn(msg) => console.warn(msg)
Expand Down
34 changes: 17 additions & 17 deletions types/r7insight_js/r7insight_js-tests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { error, info, init, log, warn } from 'r7insight_js';
import { error, info, init, log, warn } from "r7insight_js";

// @ts-expect-error
init();
Expand All @@ -7,55 +7,55 @@ init();
init({});

// @ts-expect-error
init({ token: 'token' });
init({ token: "token" });

// @ts-expect-error
init({ region: 'eu' });
init({ region: "eu" });

init({ token: 'token', region: 'eu' }); // $ExpectType void
init({ token: "token", region: "eu" }); // $ExpectType void

init({
token: 'token',
region: 'eu',
token: "token",
region: "eu",
ssl: true,
catchall: true,
trace: true,
no_format: true,
page_info: 'never',
page_info: "never",
print: true,
});

const string = 'value';
const obj = { key: 'value' };
const string = "value";
const obj = { key: "value" };

// @ts-expect-error
log();
log(undefined);
log('Message'); // $ExpectType void
log('Message with', string, ' and some objects: ', obj, 1);
log("Message"); // $ExpectType void
log("Message with", string, " and some objects: ", obj, 1);
log(obj);
log(obj, obj);

// @ts-expect-error
error();
error(undefined);
error('Message'); // $ExpectType void
error('Message with', string, ' and some objects: ', obj, 1);
error("Message"); // $ExpectType void
error("Message with", string, " and some objects: ", obj, 1);
error(obj);
error(obj, obj);

// @ts-expect-error
warn();
warn(undefined);
warn('Message'); // $ExpectType void
warn('Message with', string, ' and some objects: ', obj, 1);
warn("Message"); // $ExpectType void
warn("Message with", string, " and some objects: ", obj, 1);
warn(obj);
warn(obj, obj);

// @ts-expect-error
info();
info(undefined);
info('Message'); // $ExpectType void
info('Message with', string, ' and some objects: ', obj, 1);
info("Message"); // $ExpectType void
info("Message with", string, " and some objects: ", obj, 1);
info(obj);
info(obj, obj);
5 changes: 2 additions & 3 deletions types/rabbit.js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@

/// <reference types="node" />


import events = require('events');
import stream = require('stream');
import events = require("events");
import stream = require("stream");

export declare function createContext(url?: string): Context;

Expand Down
51 changes: 30 additions & 21 deletions types/rabbit.js/rabbit.js-tests.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@

import rabbit = require('rabbit.js');
import rabbit = require("rabbit.js");
var context = rabbit.createContext();

context.on('ready', function () { console.log('ready'); });
context.on("ready", function() {
console.log("ready");
});

var pub = context.socket<rabbit.PubSocket>('PUB');
var sub = context.socket<rabbit.SubSocket>('SUB');
var push = context.socket<rabbit.PushSocket>('PUSH');
var pull = context.socket<rabbit.PullSocket>('PULL');
var req = context.socket<rabbit.ReqSocket>('REQ');
var rep = context.socket<rabbit.RepSocket>('REP');
var task = context.socket<rabbit.TaskSocket>('TASK');
var worker = context.socket<rabbit.WorkerSocket>('WORKER');
var pub = context.socket<rabbit.PubSocket>("PUB");
var sub = context.socket<rabbit.SubSocket>("SUB");
var push = context.socket<rabbit.PushSocket>("PUSH");
var pull = context.socket<rabbit.PullSocket>("PULL");
var req = context.socket<rabbit.ReqSocket>("REQ");
var rep = context.socket<rabbit.RepSocket>("REP");
var task = context.socket<rabbit.TaskSocket>("TASK");
var worker = context.socket<rabbit.WorkerSocket>("WORKER");

pub.connect('chat');
pub.write('hello', 'utf8');
pub.connect("chat");
pub.write("hello", "utf8");
pub.close();

sub.connect('chat');
sub.on('data', function (msg: string) { console.log(msg); });
sub.connect("chat");
sub.on("data", function(msg: string) {
console.log(msg);
});
sub.close();

rep.setEncoding('utf8');
rep.on('data', function (msg: string) { rep.write('msg', 'utf8'); });
rep.connect('uppercase');
req.connect('uppercase', function () { req.pipe(process.stdout); });
rep.setEncoding("utf8");
rep.on("data", function(msg: string) {
rep.write("msg", "utf8");
});
rep.connect("uppercase");
req.connect("uppercase", function() {
req.pipe(process.stdout);
});

push.connect('items', function () { pull.pipe(push); });
push.connect("items", function() {
pull.pipe(push);
});
push.close();
pull.connect('items', function () {});
pull.connect("items", function() {});
pull.close();
6 changes: 3 additions & 3 deletions types/rabbitmq-schema/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ interface Exchange extends Topology {
}

interface FanoutExchange extends Exchange {
type: 'fanout';
type: "fanout";
}

interface TopicExchange extends Exchange {
type: 'topic';
type: "topic";
bindings: TopicBinding[];
}

interface DirectExchange extends Exchange {
type: 'direct';
type: "direct";
bindings: DirectBinding[];
}

Expand Down
10 changes: 5 additions & 5 deletions types/rabbitmq-schema/rabbitmq-schema-tests.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import RabbitMqSchema = require('rabbitmq-schema');
import RabbitMqSchema = require("rabbitmq-schema");

const topology = {};

const rabbitSchema = new RabbitMqSchema({}, '');
const rabbitSchema = new RabbitMqSchema({}, "");

rabbitSchema.getExchanges();
rabbitSchema.getBindings();
rabbitSchema.getQueues();
rabbitSchema.getDirectBindings();

rabbitSchema.getQueueByName('images.jpeg.get');
rabbitSchema.getExchangeByName('images');
rabbitSchema.getQueueByName("images.jpeg.get");
rabbitSchema.getExchangeByName("images");

rabbitSchema.validate(topology);
rabbitSchema.validateMessage('images', 'images.jpeg.get', {testMsg: 'ok'});
rabbitSchema.validateMessage("images", "images.jpeg.get", { testMsg: "ok" });
5 changes: 2 additions & 3 deletions types/radium/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

import * as React from 'react';
import * as React from "react";

export default Radium;

Expand Down Expand Up @@ -46,7 +46,7 @@ declare namespace Radium {
* StyleRoot component properties
*/
export interface StyleRootProps extends React.HTMLProps<StyleRoot> {
radiumConfig?: RadiumConfig | undefined
radiumConfig?: RadiumConfig | undefined;
}
/**
* <StyleRoot />
Expand Down Expand Up @@ -114,5 +114,4 @@ declare namespace Radium {
}

var TestMode: RadiumTestMode;

}
62 changes: 32 additions & 30 deletions types/radium/radium-tests.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import * as React from "react";
import Radium from "radium";

import * as React from "react";

@Radium
class TestComponent extends React.Component<{ a: number }> {

render() {
return (
<div >
<div>
Test with Radium
</div>
);
Expand All @@ -17,69 +15,73 @@ class TestComponent extends React.Component<{ a: number }> {
let TestStatelessComponent = (props: { a: number }) => <div />;
TestStatelessComponent = Radium(TestStatelessComponent);

<TestStatelessComponent a={5} />

<TestStatelessComponent a={5} />;

@Radium({
userAgent: "test",
matchMedia: window.matchMedia
matchMedia: window.matchMedia,
})
class TestComponentWithConfig extends React.Component<{ a?: number | undefined }> {
render() {
return (
<div>
<Radium.StyleRoot >
<Radium.Style scopeSelector="test"
<Radium.StyleRoot>
<Radium.Style
scopeSelector="test"
rules={{
a: {
background: "green"
background: "green",
},
body: {
textAlign: "center"
}
textAlign: "center",
},
}}
/>
<Radium.Style scopeSelector="test"
<Radium.Style
scopeSelector="test"
rules={{
background: "green"
background: "green",
}}
/>
</Radium.StyleRoot>
</div>
)
);
}
}
<TestComponentWithConfig a={5} />
<TestComponentWithConfig a={5} />;

class TestComponentWithConfigInStyleRoot
extends React.Component<{ a?: number | undefined }> {
class TestComponentWithConfigInStyleRoot extends React.Component<{ a?: number | undefined }> {
render() {
return (
<div>
<Radium.StyleRoot radiumConfig={{
userAgent: "test",
matchMedia: window.matchMedia
}} >
<Radium.Style scopeSelector="test"
<Radium.StyleRoot
radiumConfig={{
userAgent: "test",
matchMedia: window.matchMedia,
}}
>
<Radium.Style
scopeSelector="test"
rules={{
a: {
background: "green"
background: "green",
},
body: {
textAlign: "center"
}
textAlign: "center",
},
}}
/>
<Radium.Style scopeSelector="test"
<Radium.Style
scopeSelector="test"
rules={{
background: "green"
background: "green",
}}
/>
</Radium.StyleRoot>
</div>
)
);
}
}
<TestComponentWithConfigInStyleRoot a={5} />
<TestComponentWithConfigInStyleRoot a={5} />;

Radium.TestMode.enable();
Loading

0 comments on commit 964e498

Please sign in to comment.