Skip to content

Commit

Permalink
Eliminate all tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed May 15, 2020
1 parent 221e606 commit 048aefa
Show file tree
Hide file tree
Showing 1,758 changed files with 473,724 additions and 473,723 deletions.
62 changes: 31 additions & 31 deletions scripts/fix-tslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,46 @@ import JSON = require("comment-json");
const home = path.join(__dirname, "..", "types");

for (const dirName of fs.readdirSync(home)) {
if (dirName.startsWith(".") || dirName === "node_modules" || dirName === "scripts") {
continue;
}

const dir = path.join(home, dirName);
const stats = fs.lstatSync(dir);
if (stats.isDirectory()) {
fixTslint(dir);
// Also do it for old versions
for (const subdir of fs.readdirSync(dir)) {
if (/^v\d+$/.test(subdir)) {
fixTslint(path.join(dir, subdir));
}
}
}
if (dirName.startsWith(".") || dirName === "node_modules" || dirName === "scripts") {
continue;
}

const dir = path.join(home, dirName);
const stats = fs.lstatSync(dir);
if (stats.isDirectory()) {
fixTslint(dir);
// Also do it for old versions
for (const subdir of fs.readdirSync(dir)) {
if (/^v\d+$/.test(subdir)) {
fixTslint(path.join(dir, subdir));
}
}
}
}

function fixTslint(dir: string): void {
const target = path.join(dir, 'tslint.json');
const target = path.join(dir, 'tslint.json');
if (!fs.existsSync(target)) return;
let json = JSON.parse(fs.readFileSync(target, 'utf-8'));
json = fix(json);
const text = Object.keys(json).length === 1 ? '{ "extends": "dtslint/dt.json" }' : JSON.stringify(json, undefined, 4);
fs.writeFileSync(target, text + "\n", "utf-8");
let json = JSON.parse(fs.readFileSync(target, 'utf-8'));
json = fix(json);
const text = Object.keys(json).length === 1 ? '{ "extends": "dtslint/dt.json" }' : JSON.stringify(json, undefined, 4);
fs.writeFileSync(target, text + "\n", "utf-8");
}

function fix(config: any): any {
const out: any = {};
for (const key in config) {
let value = config[key];
out[key] = key === "rules" ? fixRules(value) : value;
}
return out;
const out: any = {};
for (const key in config) {
let value = config[key];
out[key] = key === "rules" ? fixRules(value) : value;
}
return out;
}

function fixRules(rules: any): any {
const out: any = {};
for (const key in rules) {
out[key] = rules[key];
}
return out;
const out: any = {};
for (const key in rules) {
out[key] = rules[key];
}
return out;
}

68 changes: 34 additions & 34 deletions scripts/generate-tsconfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,47 @@ import * as path from 'path';
const home = path.join(__dirname, "..", "types");

for (const dirName of fs.readdirSync(home)) {
if (dirName.startsWith(".") || dirName === "node_modules" || dirName === "scripts") {
continue;
}

const dir = path.join(home, dirName);
const stats = fs.lstatSync(dir);
if (stats.isDirectory()) {
fixTsconfig(dir);
// Also do it for old versions
for (const subdir of fs.readdirSync(dir)) {
if (/^v\d+$/.test(subdir)) {
fixTsconfig(path.join(dir, subdir));
}
}
}
if (dirName.startsWith(".") || dirName === "node_modules" || dirName === "scripts") {
continue;
}

const dir = path.join(home, dirName);
const stats = fs.lstatSync(dir);
if (stats.isDirectory()) {
fixTsconfig(dir);
// Also do it for old versions
for (const subdir of fs.readdirSync(dir)) {
if (/^v\d+$/.test(subdir)) {
fixTsconfig(path.join(dir, subdir));
}
}
}
}

function fixTsconfig(dir: string): void {
const target = path.join(dir, 'tsconfig.json');
let json = JSON.parse(fs.readFileSync(target, 'utf-8'));
json = fix(json);
fs.writeFileSync(target, JSON.stringify(json, undefined, 4), "utf-8");
const target = path.join(dir, 'tsconfig.json');
let json = JSON.parse(fs.readFileSync(target, 'utf-8'));
json = fix(json);
fs.writeFileSync(target, JSON.stringify(json, undefined, 4), "utf-8");
}

function fix(config: any): any {
const out: any = {};
for (const key in config) {
let value = config[key];
if (key === "compilerOptions") {
value = fixCompilerOptions(value);
}
out[key] = value;
}
return out;
const out: any = {};
for (const key in config) {
let value = config[key];
if (key === "compilerOptions") {
value = fixCompilerOptions(value);
}
out[key] = value;
}
return out;
}

function fixCompilerOptions(config: any): any {
const out: any = {};
for (const key in config) {
out[key] = config[key];
// Do something interesting here
}
return out;
const out: any = {};
for (const key in config) {
out[key] = config[key];
// Do something interesting here
}
return out;
}
2 changes: 1 addition & 1 deletion types/acc-wizard/acc-wizard-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ function testWithOptions() {
};

$('#test').accwizard(options);
}
}
2 changes: 1 addition & 1 deletion types/ace/test/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ const aceDocumentTests = {
doc.setValue(doc.getValue());
assert.equal("1\n2", doc.getValue());
}
};
};
2 changes: 1 addition & 1 deletion types/ace/test/editor1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ const aceEditor1Tests = {
next();
}, 600);
}
};
};
2 changes: 1 addition & 1 deletion types/ace/test/editor_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ const aceEditorNavigationTests = {
editor.navigateDown();
assert.position(editor.getCursorPosition(), 1, 7);
}
};
};
2 changes: 1 addition & 1 deletion types/ace/test/editor_text_edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,4 +495,4 @@ const aceEditorTextEditTests = {
assert.equal(session.getValue(), ["AJAX", "dot", "ORG"].join("\n"));
assert.position(editor.getCursorPosition(), 1, 0);
}
};
};
2 changes: 1 addition & 1 deletion types/add2home/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ declare var addToHome: {
close: () => void;
/** Reset the local and session storages so the popup will show again (for automatic mode - has no affect if manually opening the popup). */
reset: () => void;
};
};
2 changes: 1 addition & 1 deletion types/adone/glosses/collections/byte_array.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ declare namespace adone.collection {
* Resizes this ByteArray to be backed by a buffer of at least the given capacity.
* Will do nothing if already that large or larger.
*
* @param capacity Capacity required
* @param capacity Capacity required
*/
resize(capacity: number): this;

Expand Down
2 changes: 1 addition & 1 deletion types/adone/glosses/compressors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ declare namespace adone {
blockSize?: number;

/**
* Timeout for a single encoding operation in multi-threading mode
* Timeout for a single encoding operation in multi-threading mode
*/
timeout?: number;

Expand Down
26 changes: 13 additions & 13 deletions types/adone/glosses/math/decimal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,26 @@ declare namespace adone.math {
ceil(): Decimal;

/**
* 1 if the value of this Decimal is greater than the value of x
* 1 if the value of this Decimal is greater than the value of x
*
* -1 if the value of this Decimal is less than the value of x
* -1 if the value of this Decimal is less than the value of x
*
* 0 if this Decimal and x have the same value
* 0 if this Decimal and x have the same value
*
* NaN if the value of either this Decimal or x is NaN
* NaN if the value of either this Decimal or x is NaN
*
* @alias cmp
*/
comparedTo(x: I.Decimal.Value): number;

/**
* 1 if the value of this Decimal is greater than the value of x
* 1 if the value of this Decimal is greater than the value of x
*
* -1 if the value of this Decimal is less than the value of x
* -1 if the value of this Decimal is less than the value of x
*
* 0 if this Decimal and x have the same value
* 0 if this Decimal and x have the same value
*
* NaN if the value of either this Decimal or x is NaN
* NaN if the value of either this Decimal or x is NaN
*
* @alias comparedTo
*/
Expand Down Expand Up @@ -1133,15 +1133,15 @@ declare namespace adone.math {
static round(x: I.Decimal.Value): Decimal;

/**
* 1 if the value of x is non-zero and its sign is positive
* 1 if the value of x is non-zero and its sign is positive
*
* -1 if the value of x is non-zero and its sign is negative
* -1 if the value of x is non-zero and its sign is negative
*
* 0 if the value of x is positive zero
* 0 if the value of x is positive zero
*
* -0 if the value of x is negative zero
* -0 if the value of x is negative zero
*
* NaN if the value of x is NaN
* NaN if the value of x is NaN
*/
static sign(x: I.Decimal.Value): Decimal;

Expand Down
Loading

0 comments on commit 048aefa

Please sign in to comment.