Skip to content

Commit

Permalink
Order types, interfaces and classes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Feb 28, 2019
1 parent 4ba9054 commit e3c9d9b
Show file tree
Hide file tree
Showing 97 changed files with 1,848 additions and 1,862 deletions.
18 changes: 9 additions & 9 deletions bin/src/run/batchWarnings.ts
Expand Up @@ -4,8 +4,8 @@ import relativeId from '../../../src/utils/relativeId';
import { stderr } from '../logging';

export interface BatchWarnings {
readonly count: number;
add: (warning: string | RollupWarning) => void;
readonly count: number;
flush: () => void;
}

Expand Down Expand Up @@ -117,8 +117,8 @@ const immediateHandlers: {
// TODO select sensible priorities
const deferredHandlers: {
[code: string]: {
priority: number;
fn: (warnings: RollupWarning[]) => void;
priority: number;
};
} = {
UNUSED_EXTERNAL_IMPORT: {
Expand Down Expand Up @@ -230,11 +230,11 @@ const deferredHandlers: {
plugins.length === 0
? ''
: plugins.length > 1
? ` (such as ${plugins
.slice(0, -1)
.map(p => `'${p}'`)
.join(', ')} and '${plugins.slice(-1)}')`
: ` (such as '${plugins[0]}')`;
? ` (such as ${plugins
.slice(0, -1)
.map(p => `'${p}'`)
.join(', ')} and '${plugins.slice(-1)}')`
: ` (such as '${plugins[0]}')`;

stderr(`Plugins that transform code${detail} should generate accompanying sourcemaps`);
}
Expand Down Expand Up @@ -279,8 +279,8 @@ function info(url: string) {
}

function nest<T>(array: T[], prop: string) {
const nested: { key: string; items: T[] }[] = [];
const lookup = new Map<string, { key: string; items: T[] }>();
const nested: { items: T[]; key: string }[] = [];
const lookup = new Map<string, { items: T[]; key: string }>();

array.forEach(item => {
const key = (<any>item)[prop];
Expand Down
8 changes: 4 additions & 4 deletions bin/src/run/watch.ts
Expand Up @@ -20,16 +20,16 @@ import { printTimings } from './timings';

interface WatchEvent {
code?: string;
duration?: number;
error?: RollupError | Error;
input?: InputOption;
output?: string[];
duration?: number;
result?: RollupBuild;
}

interface Watcher {
on: (event: string, fn: (event: WatchEvent) => void) => void;
close: () => void;
on: (event: string, fn: (event: WatchEvent) => void) => void;
}

export default function watch(
Expand Down Expand Up @@ -117,8 +117,8 @@ export default function watch(
input = Array.isArray(input)
? input.join(', ')
: Object.keys(input)
.map(key => (<Record<string, string>>input)[key])
.join(', ');
.map(key => (<Record<string, string>>input)[key])
.join(', ');
}
stderr(
tc.cyan(
Expand Down

0 comments on commit e3c9d9b

Please sign in to comment.