mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 04:52:26 -05:00
Format
This commit is contained in:
parent
7828d7fd7a
commit
2da9893da3
6 changed files with 26 additions and 11 deletions
4
Makefile
4
Makefile
|
@ -31,4 +31,8 @@ lint: node_modules
|
||||||
yarn lint
|
yarn lint
|
||||||
go vet
|
go vet
|
||||||
|
|
||||||
|
fmt: node_modules
|
||||||
|
yarn fmt
|
||||||
|
go fmt
|
||||||
|
|
||||||
.PHONY: lint clean distclean
|
.PHONY: lint clean distclean
|
||||||
|
|
12
main.ts
12
main.ts
|
@ -28,11 +28,11 @@ function load(argv: string[]): void {
|
||||||
V8Worker2.recv((ab: ArrayBuffer) => {
|
V8Worker2.recv((ab: ArrayBuffer) => {
|
||||||
const msg = pb.Msg.decode(new Uint8Array(ab));
|
const msg = pb.Msg.decode(new Uint8Array(ab));
|
||||||
switch (msg.kind) {
|
switch (msg.kind) {
|
||||||
case pb.Msg.MsgKind.LOAD:
|
case pb.Msg.MsgKind.LOAD:
|
||||||
load(msg.argv);
|
load(msg.argv);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log("Unknown message", msg);
|
console.log("Unknown message", msg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"name": "deno",
|
"name": "deno",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "tslint -p tsconfig.json"
|
"lint": "tslint -p tsconfig.json",
|
||||||
|
"fmt": "prettier --write *.ts* *.js *.json"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/text-encoding": "^0.0.32",
|
"@types/text-encoding": "^0.0.32",
|
||||||
|
|
12
tslint.json
12
tslint.json
|
@ -2,7 +2,8 @@
|
||||||
"rules": {
|
"rules": {
|
||||||
"array-type": [true, "array-simple"],
|
"array-type": [true, "array-simple"],
|
||||||
"arrow-return-shorthand": true,
|
"arrow-return-shorthand": true,
|
||||||
"ban": [true,
|
"ban": [
|
||||||
|
true,
|
||||||
["fit"],
|
["fit"],
|
||||||
["fdescribe"],
|
["fdescribe"],
|
||||||
["xit"],
|
["xit"],
|
||||||
|
@ -12,7 +13,8 @@
|
||||||
["fitFakeAsync"],
|
["fitFakeAsync"],
|
||||||
["xitFakeAsync"]
|
["xitFakeAsync"]
|
||||||
],
|
],
|
||||||
"ban-types": [true,
|
"ban-types": [
|
||||||
|
true,
|
||||||
["Object", "Use {} instead."],
|
["Object", "Use {} instead."],
|
||||||
["String", "Use 'string' instead."],
|
["String", "Use 'string' instead."],
|
||||||
["Number", "Use 'number' instead."],
|
["Number", "Use 'number' instead."],
|
||||||
|
@ -41,7 +43,11 @@
|
||||||
"no-unused-variable": true,
|
"no-unused-variable": true,
|
||||||
"no-var-keyword": true,
|
"no-var-keyword": true,
|
||||||
"object-literal-shorthand": true,
|
"object-literal-shorthand": true,
|
||||||
"only-arrow-functions": [true, "allow-declarations", "allow-named-functions"],
|
"only-arrow-functions": [
|
||||||
|
true,
|
||||||
|
"allow-declarations",
|
||||||
|
"allow-named-functions"
|
||||||
|
],
|
||||||
"prefer-const": true,
|
"prefer-const": true,
|
||||||
"quotemark": [true, "double"],
|
"quotemark": [true, "double"],
|
||||||
"radix": true,
|
"radix": true,
|
||||||
|
|
2
util.ts
2
util.ts
|
@ -15,7 +15,7 @@ _global["console"] = {
|
||||||
log(...args: any[]): void {
|
log(...args: any[]): void {
|
||||||
const out: string[] = [];
|
const out: string[] = [];
|
||||||
for (const a of args) {
|
for (const a of args) {
|
||||||
if (typeof(a) === "string") {
|
if (typeof a === "string") {
|
||||||
out.push(a);
|
out.push(a);
|
||||||
} else {
|
} else {
|
||||||
out.push(JSON.stringify(a));
|
out.push(JSON.stringify(a));
|
||||||
|
|
|
@ -2816,6 +2816,10 @@ prepend-http@^1.0.0:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
|
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
|
||||||
|
|
||||||
|
prettier@^1.12.1:
|
||||||
|
version "1.12.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325"
|
||||||
|
|
||||||
private@^0.1.6, private@^0.1.8:
|
private@^0.1.6, private@^0.1.8:
|
||||||
version "0.1.8"
|
version "0.1.8"
|
||||||
resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"
|
resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"
|
||||||
|
|
Loading…
Add table
Reference in a new issue